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 StringAMQP attributes prefix.static org.springframework.util.MimeTypeMimeTypeinstance representing 'application/cloudevents' mime type.static StringString value of 'application/cloudevents' mime type.static StringString value of 'cloudevent'.static StringValue for 'data' attribute.static StringValue for 'datacontenttype' attribute.static StringValue for 'dataschema' attribute.static StringPrefix for attributes.static StringValue for 'id' attribute.static StringPrefix for attributes.static final StringV03 name for 'dataschema' attribute.static StringValue for 'source' attribute.static StringValue for 'specversion' attribute.static StringValue for 'subject' attribute.static StringValue for 'time' attribute.static StringValue for 'type' attribute. -
Method Summary
Modifier and TypeMethodDescriptiongetAttributes(org.springframework.messaging.Message<?> message) static <T> TgetData(org.springframework.messaging.Message<?> message) static StringgetDataContentType(org.springframework.messaging.Message<?> message) static URIgetDataSchema(org.springframework.messaging.Message<?> message) static StringgetId(org.springframework.messaging.Message<?> message) static URIgetSource(org.springframework.messaging.Message<?> message) static StringgetSpecVersion(org.springframework.messaging.Message<?> message) static StringgetSubject(org.springframework.messaging.Message<?> message) static OffsetDateTimegetTime(org.springframework.messaging.Message<?> message) static StringgetType(org.springframework.messaging.Message<?> message) static booleanisCloudEvent(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_CLOUDEVENTSMimeTypeinstance 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
-