Class ServiceBusTemplate
java.lang.Object
com.azure.spring.messaging.servicebus.core.ServiceBusTemplate
- All Implemented Interfaces:
SendOperation
Azure Service Bus template to support send
Message
asynchronously.
A defaultEntityType
is required when no entity type is specified in ServiceBusProducerFactory
via related NamespaceProperties
or producer PropertiesSupplier
.
-
Constructor Summary
ConstructorDescriptionServiceBusTemplate
(ServiceBusProducerFactory producerFactory) Create an instance using the supplied producer factory. -
Method Summary
Modifier and TypeMethodDescriptionGet the message converter.void
setDefaultEntityType
(com.azure.spring.cloud.service.servicebus.properties.ServiceBusEntityType entityType) Set the default entity type of the destination to be sent messages to.void
setMessageConverter
(ServiceBusMessageConverter 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
-
ServiceBusTemplate
Create an instance using the supplied producer factory.- Parameters:
producerFactory
- the producer factory.
-
-
Method Details
-
sendAsync
public <U> Mono<Void> sendAsync(String destination, org.springframework.messaging.Message<U> message) - Specified by:
sendAsync
in interfaceSendOperation
-
setMessageConverter
Set the message converter.- Parameters:
messageConverter
- the message converter.
-
getMessageConverter
Get the message converter.- Returns:
- the message converter.
-
setDefaultEntityType
public void setDefaultEntityType(com.azure.spring.cloud.service.servicebus.properties.ServiceBusEntityType entityType) Set the default entity type of the destination to be sent messages to. Required when no entity type is specified inServiceBusProducerFactory
via related theNamespaceProperties
or producerPropertiesSupplier
.- Parameters:
entityType
- the entity type.
-