Class MethodRabbitListenerEndpoint
java.lang.Object
org.springframework.amqp.rabbit.listener.AbstractRabbitListenerEndpoint
org.springframework.amqp.rabbit.listener.MethodRabbitListenerEndpoint
- All Implemented Interfaces:
RabbitListenerEndpoint,Aware,BeanFactoryAware
- Direct Known Subclasses:
MultiMethodRabbitListenerEndpoint
A
RabbitListenerEndpoint providing the method to invoke to process
an incoming message for this endpoint.- Since:
- 1.4
- Author:
- Stephane Nicoll, Artem Bilan, Gary Russell
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceProvider of listener adapters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected HandlerAdapterconfigureListenerAdapter(MessagingMessageListenerAdapter messageListener) Create aHandlerAdapterfor this listener adapter.protected MessagingMessageListenerAdaptercreateMessageListener(MessageListenerContainer container) Create aMessageListenerthat is able to serve this endpoint for the specified container.protected MessagingMessageListenerAdapterCreate an emptyMessagingMessageListenerAdapterinstance.getBean()protected StringBuilderprotected MessageHandlerMethodFactoryvoidsetAdapterProvider(MethodRabbitListenerEndpoint.AdapterProvider adapterProvider) Set a provider to create adapter instances.voidSet the object instance that should manage this endpoint.voidsetErrorHandler(RabbitListenerErrorHandler errorHandler) Set theRabbitListenerErrorHandlerto invoke if the listener method throws an exception.voidsetMessageHandlerMethodFactory(MessageHandlerMethodFactory messageHandlerMethodFactory) Set theMessageHandlerMethodFactoryto use to build theInvocableHandlerMethodresponsible to manage the invocation of this endpoint.voidSet the method to invoke to process a message managed by this endpoint.voidsetReturnExceptions(boolean returnExceptions) Set whether exceptions thrown by the listener should be returned to the sender using the normalreplyTo/@SendTosemantics.Methods inherited from class org.springframework.amqp.rabbit.listener.AbstractRabbitListenerEndpoint
getAckMode, getAdmin, getAutoStartup, getBatchingStrategy, getBeanExpressionContext, getBeanFactory, getBeanResolver, getConcurrency, getGroup, getId, getMessageConverter, getPriority, getQueueNames, getQueues, getReplyContentType, getReplyPostProcessor, getResolver, getTaskExecutor, isBatchListener, isConverterWinsContentType, isExclusive, setAckMode, setAdmin, setAutoStartup, setBatchingStrategy, setBatchListener, setBeanFactory, setConcurrency, setConverterWinsContentType, setExclusive, setGroup, setId, setMessageConverter, setPriority, setQueueNames, setQueues, setReplyContentType, setReplyPostProcessor, setTaskExecutor, setupListenerContainer, toString
-
Constructor Details
-
MethodRabbitListenerEndpoint
public MethodRabbitListenerEndpoint()
-
-
Method Details
-
setBean
Set the object instance that should manage this endpoint.- Parameters:
bean- the target bean instance.
-
getBean
-
setMethod
Set the method to invoke to process a message managed by this endpoint.- Parameters:
method- the target method for thebean.
-
getMethod
-
setMessageHandlerMethodFactory
Set theMessageHandlerMethodFactoryto use to build theInvocableHandlerMethodresponsible to manage the invocation of this endpoint.- Parameters:
messageHandlerMethodFactory- theMessageHandlerMethodFactoryinstance.
-
setReturnExceptions
public void setReturnExceptions(boolean returnExceptions) Set whether exceptions thrown by the listener should be returned to the sender using the normalreplyTo/@SendTosemantics.- Parameters:
returnExceptions- true to return exceptions.- Since:
- 2.0
-
setErrorHandler
Set theRabbitListenerErrorHandlerto invoke if the listener method throws an exception.- Parameters:
errorHandler- the error handler.- Since:
- 2.0
-
getMessageHandlerMethodFactory
- Returns:
- the messageHandlerMethodFactory
-
setAdapterProvider
Set a provider to create adapter instances.- Parameters:
adapterProvider- the provider.
-
createMessageListener
Description copied from class:AbstractRabbitListenerEndpointCreate aMessageListenerthat is able to serve this endpoint for the specified container.- Specified by:
createMessageListenerin classAbstractRabbitListenerEndpoint- Parameters:
container- theMessageListenerContainerto create aMessageListener.- Returns:
- a a
MessageListenerinstance.
-
configureListenerAdapter
Create aHandlerAdapterfor this listener adapter.- Parameters:
messageListener- the listener adapter.- Returns:
- the handler adapter.
-
createMessageListenerInstance
Create an emptyMessagingMessageListenerAdapterinstance.- Returns:
- the
MessagingMessageListenerAdapterinstance.
-
getEndpointDescription
- Overrides:
getEndpointDescriptionin classAbstractRabbitListenerEndpoint- Returns:
- a description for this endpoint.
Available to subclasses, for inclusion in their
toString()result.
-