Class EventHubsMessageConverter

java.lang.Object
com.azure.spring.messaging.converter.AbstractAzureMessageConverter<com.azure.messaging.eventhubs.EventData,com.azure.messaging.eventhubs.EventData>
com.azure.spring.messaging.eventhubs.support.converter.EventHubsMessageConverter
All Implemented Interfaces:
AzureMessageConverter<com.azure.messaging.eventhubs.EventData,com.azure.messaging.eventhubs.EventData>

public class EventHubsMessageConverter extends AbstractAzureMessageConverter<com.azure.messaging.eventhubs.EventData,com.azure.messaging.eventhubs.EventData>
A converter to turn a Message to EventData and vice versa.
  • Constructor Details

    • EventHubsMessageConverter

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

      public EventHubsMessageConverter(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.eventhubs.EventData,com.azure.messaging.eventhubs.EventData>
    • getPayload

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

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

      protected com.azure.messaging.eventhubs.EventData fromByte(byte[] payload)
      Specified by:
      fromByte in class AbstractAzureMessageConverter<com.azure.messaging.eventhubs.EventData,com.azure.messaging.eventhubs.EventData>
    • setCustomHeaders

      protected void setCustomHeaders(org.springframework.messaging.MessageHeaders headers, com.azure.messaging.eventhubs.EventData azureMessage)
      Overrides:
      setCustomHeaders in class AbstractAzureMessageConverter<com.azure.messaging.eventhubs.EventData,com.azure.messaging.eventhubs.EventData>
    • buildCustomHeaders

      protected Map<String,Object> buildCustomHeaders(com.azure.messaging.eventhubs.EventData azureMessage)
      Overrides:
      buildCustomHeaders in class AbstractAzureMessageConverter<com.azure.messaging.eventhubs.EventData,com.azure.messaging.eventhubs.EventData>