Class ServiceBusMessageListenerContainer

java.lang.Object
com.azure.spring.messaging.listener.AbstractMessageListenerContainer
com.azure.spring.messaging.servicebus.core.listener.ServiceBusMessageListenerContainer
All Implemented Interfaces:
MessageListenerContainer, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class ServiceBusMessageListenerContainer extends AbstractMessageListenerContainer
A message listener container wrapping ServiceBusProcessorClient to subscribe to Service Bus queue/topic entities and consume messages.

For different combinations of Service Bus entity name and subscription, different ServiceBusProcessorClients will be created to subscribe to it.

See Also:
  • Constructor Details

    • ServiceBusMessageListenerContainer

      public ServiceBusMessageListenerContainer(ServiceBusProcessorFactory processorFactory, ServiceBusContainerProperties containerProperties)
      Create an instance using the supplied processor factory and container properties.
      Parameters:
      processorFactory - the processor factory.
      containerProperties - the container properties.
  • Method Details

    • doStart

      protected void doStart()
      Specified by:
      doStart in class AbstractMessageListenerContainer
    • doStop

      protected void doStop()
      Specified by:
      doStop in class AbstractMessageListenerContainer
    • setupMessageListener

      public void setupMessageListener(com.azure.spring.cloud.service.listener.MessageListener<?> messageListener)
    • getContainerProperties

      public ServiceBusContainerProperties getContainerProperties()
    • setErrorHandler

      public void setErrorHandler(com.azure.spring.cloud.service.servicebus.consumer.ServiceBusErrorHandler errorHandler)
      Set the error handler to call when the listener throws an exception.
      Parameters:
      errorHandler - the error handler.