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 Details

    • ServiceBusMessageConverter

      public ServiceBusMessageConverter()
      Construct the message converter with default ObjectMapper.
    • ServiceBusMessageConverter

      public ServiceBusMessageConverter(ObjectMapper objectMapper)
      Construct the message converter with customized ObjectMapper.
      Parameters:
      objectMapper - the object mapper.
  • Method Details

    • getObjectMapper

      protected ObjectMapper getObjectMapper()
      Specified by:
      getObjectMapper in class AbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,com.azure.messaging.servicebus.ServiceBusMessage>
    • getPayload

      protected byte[] getPayload(com.azure.messaging.servicebus.ServiceBusReceivedMessage azureMessage)
      Specified by:
      getPayload in class AbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,com.azure.messaging.servicebus.ServiceBusMessage>
    • fromString

      protected com.azure.messaging.servicebus.ServiceBusMessage fromString(String payload)
      Specified by:
      fromString in class AbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,com.azure.messaging.servicebus.ServiceBusMessage>
    • fromByte

      protected com.azure.messaging.servicebus.ServiceBusMessage fromByte(byte[] payload)
      Specified by:
      fromByte in class AbstractAzureMessageConverter<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 class AbstractAzureMessageConverter<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 class AbstractAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,com.azure.messaging.servicebus.ServiceBusMessage>