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
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 ServiceBusProcessorClient
s
will be created to subscribe to it.
- See Also:
-
Field Summary
Fields inherited from class com.azure.spring.messaging.listener.AbstractMessageListenerContainer
lifecycleMonitor
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ConstructorDescriptionServiceBusMessageListenerContainer
(ServiceBusProcessorFactory processorFactory, ServiceBusContainerProperties containerProperties) Create an instance using the supplied processor factory and container properties. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doStart()
protected void
doStop()
void
setErrorHandler
(com.azure.spring.cloud.service.servicebus.consumer.ServiceBusErrorHandler errorHandler) Set the error handler to call when the listener throws an exception.void
setupMessageListener
(com.azure.spring.cloud.service.listener.MessageListener<?> messageListener) Methods inherited from class com.azure.spring.messaging.listener.AbstractMessageListenerContainer
getBeanName, getPhase, isActive, isRunning, setBeanName, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.SmartLifecycle
isAutoStartup
-
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 classAbstractMessageListenerContainer
-
doStop
protected void doStop()- Specified by:
doStop
in classAbstractMessageListenerContainer
-
setupMessageListener
public void setupMessageListener(com.azure.spring.cloud.service.listener.MessageListener<?> messageListener) -
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.
-