Class CloudEventMessageUtils
java.lang.Object
org.springframework.cloud.function.cloudevent.CloudEventMessageUtils
Miscellaneous utility methods to assist with representing Cloud Event as Spring
Primarily intended for the internal use within Spring-based frameworks and integrations.
Message
. Primarily intended for the internal use within Spring-based frameworks and integrations.
- Since:
- 3.1
- Author:
- Oleg Zhurakousky, Dave Syer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String
AMQP attributes prefix.static org.springframework.util.MimeType
MimeType
instance representing 'application/cloudevents' mime type.static String
String value of 'application/cloudevents' mime type.static String
String value of 'cloudevent'.static String
Value for 'data' attribute.static String
Value for 'datacontenttype' attribute.static String
Value for 'dataschema' attribute.static String
Prefix for attributes.static String
Value for 'id' attribute.static String
Prefix for attributes.static final String
V03 name for 'dataschema' attribute.static String
Value for 'source' attribute.static String
Value for 'specversion' attribute.static String
Value for 'subject' attribute.static String
Value for 'time' attribute.static String
Value for 'type' attribute. -
Method Summary
Modifier and TypeMethodDescriptiongetAttributes
(org.springframework.messaging.Message<?> message) static <T> T
getData
(org.springframework.messaging.Message<?> message) static String
getDataContentType
(org.springframework.messaging.Message<?> message) static URI
getDataSchema
(org.springframework.messaging.Message<?> message) static String
getId
(org.springframework.messaging.Message<?> message) static URI
getSource
(org.springframework.messaging.Message<?> message) static String
getSpecVersion
(org.springframework.messaging.Message<?> message) static String
getSubject
(org.springframework.messaging.Message<?> message) static OffsetDateTime
getTime
(org.springframework.messaging.Message<?> message) static String
getType
(org.springframework.messaging.Message<?> message) static boolean
isCloudEvent
(org.springframework.messaging.Message<?> message) Will check for the existence of required attributes.
-
Field Details
-
CLOUDEVENT_VALUE
String value of 'cloudevent'. Typically used asMessageUtils.MESSAGE_TYPE
-
APPLICATION_CLOUDEVENTS_VALUE
String value of 'application/cloudevents' mime type. -
APPLICATION_CLOUDEVENTS
public static org.springframework.util.MimeType APPLICATION_CLOUDEVENTSMimeType
instance representing 'application/cloudevents' mime type. -
DEFAULT_ATTR_PREFIX
Prefix for attributes. -
AMQP_ATTR_PREFIX
AMQP attributes prefix. -
KAFKA_ATTR_PREFIX
Prefix for attributes. -
DATA
Value for 'data' attribute. -
ID
Value for 'id' attribute. -
SOURCE
Value for 'source' attribute. -
SPECVERSION
Value for 'specversion' attribute. -
TYPE
Value for 'type' attribute. -
DATACONTENTTYPE
Value for 'datacontenttype' attribute. -
DATASCHEMA
Value for 'dataschema' attribute. -
SCHEMAURL
V03 name for 'dataschema' attribute. -
SUBJECT
Value for 'subject' attribute. -
TIME
Value for 'time' attribute.
-
-
Method Details
-
getId
-
getSource
-
getSpecVersion
-
getType
-
getDataContentType
-
getDataSchema
-
getSubject
-
getTime
-
getData
public static <T> T getData(org.springframework.messaging.Message<?> message) -
getAttributes
-
isCloudEvent
public static boolean isCloudEvent(org.springframework.messaging.Message<?> message) Will check for the existence of required attributes. Assumes attributes (headers) are in canonical form.- Parameters:
message
- inputMessage
- Returns:
- true if this Message represents Cloud Event in binary-mode
-