public final class ProtonAmqpBinaryMessageReader extends BaseGenericBinaryMessageReaderImpl<String,Object>
This reader reads sections of an AMQP message to construct a CloudEvent representation by doing the following:
| Constructor and Description |
|---|
ProtonAmqpBinaryMessageReader(io.cloudevents.SpecVersion version,
ApplicationProperties applicationProperties,
String contentType,
byte[] payload)
Create an instance of an AMQP message reader.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
forEachHeader(BiConsumer<String,Object> fn)
Visits the content-type message property and all application-properties of this message reader.
|
protected boolean |
isCloudEventsHeader(String key)
Tests whether the given attribute key is prefixed with cloudEvents:
|
protected boolean |
isContentTypeHeader(String key) |
protected String |
toCloudEventsKey(String key)
Gets the cloud event attribute key without the preceding prefix.
|
protected String |
toCloudEventsValue(Object value)
Gets the cloud event representation of the value.
|
readgetEncoding, readclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitread, read, toEvent, toEventfrom, frompublic ProtonAmqpBinaryMessageReader(io.cloudevents.SpecVersion version,
ApplicationProperties applicationProperties,
String contentType,
byte[] payload)
version - The version of the cloud event message.applicationProperties - The application properties of the AMQP message that contains
the cloud event metadata (i.e attributes and extensions).
The applicationProperties MUST not be null.contentType - The content-type property of the AMQP message or null if the message content type is unknown.payload - The message payload or null if the message does not contain any payload.NullPointerException - if the applicationPropereties is null.protected boolean isContentTypeHeader(String key)
isContentTypeHeader in class BaseGenericBinaryMessageReaderImpl<String,Object>protected boolean isCloudEventsHeader(String key)
isCloudEventsHeader in class BaseGenericBinaryMessageReaderImpl<String,Object>key - The key to test for the presence of the prefix.protected String toCloudEventsKey(String key)
toCloudEventsKey in class BaseGenericBinaryMessageReaderImpl<String,Object>key - The key containing the AMQP specific prefix.protected void forEachHeader(BiConsumer<String,Object> fn)
This method only visits properties containing a name and value which are not null.
forEachHeader in class BaseGenericBinaryMessageReaderImpl<String,Object>fn - A callback to consume this reader's application-properties
and content-type property.protected String toCloudEventsValue(Object value)
This method simply returns the string representation of the type of value passed as argument.
toCloudEventsValue in class BaseGenericBinaryMessageReaderImpl<String,Object>value - The value of a CloudEvent attribute or extension.Copyright © 2022. All rights reserved.