Class EventHubsTemplate
java.lang.Object
com.azure.spring.messaging.eventhubs.core.EventHubsTemplate
- All Implemented Interfaces:
SendOperation
A template for executing sending operations asynchronously to Event Hubs.
-
Constructor Summary
ConstructorDescriptionEventHubsTemplate
(EventHubsProducerFactory producerFactory) Create an instance using the supplied producer factory. -
Method Summary
Modifier and TypeMethodDescription<T> void
send
(String destination, Collection<org.springframework.messaging.Message<T>> messages) Send aCollection
<Message
> to the given destination synchronously.<T> void
send
(String destination, Collection<org.springframework.messaging.Message<T>> messages, PartitionSupplier partitionSupplier) Send aCollection
<Message
> to the given destination with a given partition supplier synchronously.sendAsync
(String destination, Collection<org.springframework.messaging.Message<T>> messages) Send aCollection
<Message
> to the given destination asynchronously.sendAsync
(String destination, Collection<org.springframework.messaging.Message<T>> messages, PartitionSupplier partitionSupplier) Send aCollection
<Message
> to the given destination with a given partition supplier asynchronously.void
setMessageConverter
(EventHubsMessageConverter messageConverter) Set the message converter.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.core.SendOperation
send
-
Constructor Details
-
EventHubsTemplate
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 aCollection
<Message
> to the given destination with a given partition supplier asynchronously.- Type Parameters:
T
- payload type in message- Parameters:
destination
- destinationmessages
- message setpartitionSupplier
- partition supplier- Returns:
- Mono Void
-
sendAsync
public <T> Mono<Void> sendAsync(String destination, Collection<org.springframework.messaging.Message<T>> messages) Send aCollection
<Message
> to the given destination asynchronously.- Type Parameters:
T
- payload type in message- Parameters:
destination
- destinationmessages
- message set- Returns:
- Mono Void
-
send
public <T> void send(String destination, Collection<org.springframework.messaging.Message<T>> messages, PartitionSupplier partitionSupplier) Send aCollection
<Message
> to the given destination with a given partition supplier synchronously.- Type Parameters:
T
- payload type in message- Parameters:
destination
- destinationmessages
- message setpartitionSupplier
- partition supplier
-
send
public <T> void send(String destination, Collection<org.springframework.messaging.Message<T>> messages) Send aCollection
<Message
> to the given destination synchronously.- Type Parameters:
T
- payload type in message- Parameters:
destination
- destinationmessages
- message set
-
sendAsync
public <T> Mono<Void> sendAsync(String destination, org.springframework.messaging.Message<T> message) - Specified by:
sendAsync
in interfaceSendOperation
-
setMessageConverter
Set the message converter.- Parameters:
messageConverter
- the message converter.
-