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
ConstructorsConstructorDescriptionServiceBusTemplate(ServiceBusProducerFactory producerFactory) Create an instance using the supplied producer factory. -
Method Summary
Modifier and TypeMethodDescriptionAzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage, com.azure.messaging.servicebus.ServiceBusMessage> Get the message converter.voidsetDefaultEntityType(com.azure.spring.cloud.service.servicebus.properties.ServiceBusEntityType entityType) Set the default entity type of the destination to be sent messages to.voidsetMessageConverter(AzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage, com.azure.messaging.servicebus.ServiceBusMessage> messageConverter) Set the message converter to use.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
sendAsyncin interfaceSendOperation
-
setMessageConverter
public void setMessageConverter(AzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage, com.azure.messaging.servicebus.ServiceBusMessage> messageConverter) Set the message converter to use.- Parameters:
messageConverter- the message converter.
-
getMessageConverter
public AzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,com.azure.messaging.servicebus.ServiceBusMessage> 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 inServiceBusProducerFactoryvia related theNamespacePropertiesor producerPropertiesSupplier.- Parameters:
entityType- the entity type.
-