Class EventHubsBatchMessageConverter
java.lang.Object
com.azure.spring.messaging.converter.AbstractAzureMessageConverter<com.azure.messaging.eventhubs.models.EventBatchContext,com.azure.messaging.eventhubs.EventData>
com.azure.spring.messaging.eventhubs.support.converter.EventHubsBatchMessageConverter
- All Implemented Interfaces:
AzureMessageConverter<com.azure.messaging.eventhubs.models.EventBatchContext,
com.azure.messaging.eventhubs.EventData>
public class EventHubsBatchMessageConverter
extends AbstractAzureMessageConverter<com.azure.messaging.eventhubs.models.EventBatchContext,com.azure.messaging.eventhubs.EventData>
A converter to turn a
EventBatchContext
to
Message
and vice versa.-
Constructor Summary
ConstructorDescriptionConstruct the message converter with defaultObjectMapper
.EventHubsBatchMessageConverter
(ObjectMapper objectMapper) Construct the message converter with customizedObjectMapper
. -
Method Summary
Modifier and TypeMethodDescriptionbuildCustomHeaders
(com.azure.messaging.eventhubs.models.EventBatchContext azureMessage) protected com.azure.messaging.eventhubs.EventData
fromByte
(byte[] payload) protected com.azure.messaging.eventhubs.EventData
fromString
(String payload) protected ObjectMapper
protected Object
getPayload
(com.azure.messaging.eventhubs.models.EventBatchContext azureMessage) protected <U> org.springframework.messaging.Message<?>
internalToMessage
(com.azure.messaging.eventhubs.models.EventBatchContext azureMessage, Map<String, Object> headers, Class<U> targetPayloadClass) adapt the payload and header for the target messageprotected void
setCustomHeaders
(org.springframework.messaging.MessageHeaders headers, com.azure.messaging.eventhubs.EventData azureMessage) Methods inherited from class com.azure.spring.messaging.converter.AbstractAzureMessageConverter
fromMessage, fromPayload, toMessage, toPayload
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.spring.messaging.converter.AzureMessageConverter
toMessage
-
Constructor Details
-
EventHubsBatchMessageConverter
public EventHubsBatchMessageConverter()Construct the message converter with defaultObjectMapper
. -
EventHubsBatchMessageConverter
Construct the message converter with customizedObjectMapper
.- Parameters:
objectMapper
- the object mapper.
-
-
Method Details
-
getObjectMapper
- Specified by:
getObjectMapper
in classAbstractAzureMessageConverter<com.azure.messaging.eventhubs.models.EventBatchContext,
com.azure.messaging.eventhubs.EventData>
-
fromString
- Specified by:
fromString
in classAbstractAzureMessageConverter<com.azure.messaging.eventhubs.models.EventBatchContext,
com.azure.messaging.eventhubs.EventData>
-
fromByte
protected com.azure.messaging.eventhubs.EventData fromByte(byte[] payload) - Specified by:
fromByte
in classAbstractAzureMessageConverter<com.azure.messaging.eventhubs.models.EventBatchContext,
com.azure.messaging.eventhubs.EventData>
-
setCustomHeaders
protected void setCustomHeaders(org.springframework.messaging.MessageHeaders headers, com.azure.messaging.eventhubs.EventData azureMessage) - Overrides:
setCustomHeaders
in classAbstractAzureMessageConverter<com.azure.messaging.eventhubs.models.EventBatchContext,
com.azure.messaging.eventhubs.EventData>
-
getPayload
- Specified by:
getPayload
in classAbstractAzureMessageConverter<com.azure.messaging.eventhubs.models.EventBatchContext,
com.azure.messaging.eventhubs.EventData>
-
internalToMessage
protected <U> org.springframework.messaging.Message<?> internalToMessage(com.azure.messaging.eventhubs.models.EventBatchContext azureMessage, Map<String, Object> headers, Class<U> targetPayloadClass) adapt the payload and header for the target message- Overrides:
internalToMessage
in classAbstractAzureMessageConverter<com.azure.messaging.eventhubs.models.EventBatchContext,
com.azure.messaging.eventhubs.EventData> - Type Parameters:
U
- targetPayloadType- Parameters:
azureMessage
- the context holding the original message payloadheaders
- headers of original messagetargetPayloadClass
- the type of target message- Returns:
- the target message
-
buildCustomHeaders
protected Map<String,Object> buildCustomHeaders(com.azure.messaging.eventhubs.models.EventBatchContext azureMessage) - Overrides:
buildCustomHeaders
in classAbstractAzureMessageConverter<com.azure.messaging.eventhubs.models.EventBatchContext,
com.azure.messaging.eventhubs.EventData>
-