Class ServiceBusTemplate

java.lang.Object
com.azure.spring.messaging.servicebus.core.ServiceBusTemplate
All Implemented Interfaces:
SendOperation

public class ServiceBusTemplate extends Object implements 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 Details Link icon

    • ServiceBusTemplate Link icon

      public ServiceBusTemplate(@NonNull ServiceBusProducerFactory producerFactory)
      Create an instance using the supplied producer factory.
      Parameters:
      producerFactory - the producer factory.
  • Method Details Link icon

    • sendAsync Link icon

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

      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 Link icon

      public AzureMessageConverter<com.azure.messaging.servicebus.ServiceBusReceivedMessage,com.azure.messaging.servicebus.ServiceBusMessage> getMessageConverter()
      Get the message converter.
      Returns:
      the message converter.
    • setDefaultEntityType Link icon

      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 in ServiceBusProducerFactory via related the NamespaceProperties or producer PropertiesSupplier.
      Parameters:
      entityType - the entity type.