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

    • ServiceBusTemplate

      public ServiceBusTemplate(@NonNull ServiceBusProducerFactory producerFactory)
      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 interface SendOperation
    • setMessageConverter

      public void setMessageConverter(ServiceBusMessageConverter messageConverter)
      Set the message converter.
      Parameters:
      messageConverter - the message converter.
    • getMessageConverter

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