Class ServiceBusMessageConverter
java.lang.Object
com.azure.spring.messaging.converter.AbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,com.azure.messaging.servicebus.ServiceBusMessage>
com.azure.spring.messaging.servicebus.support.converter.ServiceBusMessageConverter
- All Implemented Interfaces:
AzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,
com.azure.messaging.servicebus.ServiceBusMessage>
public class ServiceBusMessageConverter
extends AbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,com.azure.messaging.servicebus.ServiceBusMessage>
A converter to turn a
Message
to ServiceBusMessage
and turn a ServiceBusReceivedMessage
to Message
-
Constructor Summary
ConstructorDescriptionConstruct the message converter with defaultObjectMapper
.ServiceBusMessageConverter
(ObjectMapper objectMapper) Construct the message converter with customizedObjectMapper
. -
Method Summary
Modifier and TypeMethodDescriptionbuildCustomHeaders
(com.azure.messaging.servicebus.ServiceBusReceivedMessage message) protected com.azure.messaging.servicebus.ServiceBusMessage
fromByte
(byte[] payload) protected com.azure.messaging.servicebus.ServiceBusMessage
fromString
(String payload) protected ObjectMapper
protected byte[]
getPayload
(com.azure.messaging.servicebus.ServiceBusReceivedMessage azureMessage) protected void
setCustomHeaders
(org.springframework.messaging.MessageHeaders headers, com.azure.messaging.servicebus.ServiceBusMessage message) Methods inherited from class com.azure.spring.messaging.converter.AbstractAzureMessageConverter
fromMessage, fromPayload, internalToMessage, 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
-
ServiceBusMessageConverter
public ServiceBusMessageConverter()Construct the message converter with defaultObjectMapper
. -
ServiceBusMessageConverter
Construct the message converter with customizedObjectMapper
.- Parameters:
objectMapper
- the object mapper.
-
-
Method Details
-
getObjectMapper
- Specified by:
getObjectMapper
in classAbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,
com.azure.messaging.servicebus.ServiceBusMessage>
-
getPayload
protected byte[] getPayload(com.azure.messaging.servicebus.ServiceBusReceivedMessage azureMessage) - Specified by:
getPayload
in classAbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,
com.azure.messaging.servicebus.ServiceBusMessage>
-
fromString
- Specified by:
fromString
in classAbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,
com.azure.messaging.servicebus.ServiceBusMessage>
-
fromByte
protected com.azure.messaging.servicebus.ServiceBusMessage fromByte(byte[] payload) - Specified by:
fromByte
in classAbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,
com.azure.messaging.servicebus.ServiceBusMessage>
-
setCustomHeaders
protected void setCustomHeaders(org.springframework.messaging.MessageHeaders headers, com.azure.messaging.servicebus.ServiceBusMessage message) - Overrides:
setCustomHeaders
in classAbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,
com.azure.messaging.servicebus.ServiceBusMessage>
-
buildCustomHeaders
protected Map<String,Object> buildCustomHeaders(com.azure.messaging.servicebus.ServiceBusReceivedMessage message) - Overrides:
buildCustomHeaders
in classAbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,
com.azure.messaging.servicebus.ServiceBusMessage>
-