Class EventHubsTemplate

java.lang.Object
com.azure.spring.messaging.eventhubs.core.EventHubsTemplate
All Implemented Interfaces:
SendOperation

public class EventHubsTemplate extends Object implements SendOperation
A template for executing sending operations asynchronously to Event Hubs.
  • Constructor Details

    • EventHubsTemplate

      public EventHubsTemplate(EventHubsProducerFactory producerFactory)
      Create an instance using the supplied producer factory.
      Parameters:
      producerFactory - the producer factory.
  • Method Details

    • sendAsync

      public <T> Mono<Void> sendAsync(String destination, Collection<org.springframework.messaging.Message<T>> messages, PartitionSupplier partitionSupplier)
      Send a Collection<Message> to the given destination with a given partition supplier asynchronously.
      Type Parameters:
      T - payload type in message
      Parameters:
      destination - destination
      messages - message set
      partitionSupplier - partition supplier
      Returns:
      Mono Void
    • sendAsync

      public <T> Mono<Void> sendAsync(String destination, Collection<org.springframework.messaging.Message<T>> messages)
      Send a Collection<Message> to the given destination asynchronously.
      Type Parameters:
      T - payload type in message
      Parameters:
      destination - destination
      messages - message set
      Returns:
      Mono Void
    • send

      public <T> void send(String destination, Collection<org.springframework.messaging.Message<T>> messages, PartitionSupplier partitionSupplier)
      Send a Collection<Message> to the given destination with a given partition supplier synchronously.
      Type Parameters:
      T - payload type in message
      Parameters:
      destination - destination
      messages - message set
      partitionSupplier - partition supplier
    • send

      public <T> void send(String destination, Collection<org.springframework.messaging.Message<T>> messages)
      Send a Collection<Message> to the given destination synchronously.
      Type Parameters:
      T - payload type in message
      Parameters:
      destination - destination
      messages - message set
    • sendAsync

      public <T> Mono<Void> sendAsync(String destination, org.springframework.messaging.Message<T> message)
      Specified by:
      sendAsync in interface SendOperation
    • setMessageConverter

      public void setMessageConverter(AzureMessageConverter<com.azure.messaging.eventhubs.EventData,com.azure.messaging.eventhubs.EventData> messageConverter)
      Set the message converter to use.
      Parameters:
      messageConverter - the message converter.