public abstract class AbstractRabbitListenerEndpoint extends Object implements RabbitListenerEndpoint, BeanFactoryAware
MethodRabbitListenerEndpoint,
SimpleRabbitListenerEndpoint| Constructor and Description |
|---|
AbstractRabbitListenerEndpoint() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract MessageListener |
createMessageListener(MessageListenerContainer container)
Create a
MessageListener that is able to serve this endpoint for the
specified container. |
AcknowledgeMode |
getAckMode()
Override the container factory's
AcknowledgeMode. |
AmqpAdmin |
getAdmin() |
Boolean |
getAutoStartup()
Override of the default autoStartup property.
|
BatchingStrategy |
getBatchingStrategy() |
protected BeanExpressionContext |
getBeanExpressionContext() |
protected BeanFactory |
getBeanFactory() |
protected BeanResolver |
getBeanResolver() |
String |
getConcurrency()
The concurrency of this endpoint; Not used by this abstract class;
used by subclasses to set the concurrency appropriate for the container type.
|
protected StringBuilder |
getEndpointDescription() |
String |
getGroup() |
String |
getId() |
MessageConverter |
getMessageConverter()
Used by the container factory to check if this endpoint supports the
preferred way for a container factory to pass a message converter
to the endpoint's adapter.
|
Integer |
getPriority() |
Collection<String> |
getQueueNames() |
Collection<Queue> |
getQueues() |
String |
getReplyContentType()
Get the reply content type.
|
ReplyPostProcessor |
getReplyPostProcessor()
Return a
ReplyPostProcessor to post process a reply message before it is
sent. |
protected BeanExpressionResolver |
getResolver() |
TaskExecutor |
getTaskExecutor()
Get the task executor to use for this endpoint's listener container.
|
boolean |
isBatchListener() |
boolean |
isConverterWinsContentType()
Return whether the content type set by a converter prevails or not.
|
boolean |
isExclusive() |
void |
setAckMode(AcknowledgeMode mode) |
void |
setAdmin(AmqpAdmin admin)
Set the
AmqpAdmin instance to use. |
void |
setAutoStartup(Boolean autoStartup)
Override the default autoStartup property.
|
void |
setBatchingStrategy(BatchingStrategy batchingStrategy)
Set a
BatchingStrategy to use when debatching messages. |
void |
setBatchListener(boolean batchListener)
Set to true if this endpoint should create a batch listener.
|
void |
setBeanFactory(BeanFactory beanFactory) |
void |
setConcurrency(String concurrency)
Set the concurrency of this endpoint; usually overrides any concurrency
settings on the container factory.
|
void |
setConverterWinsContentType(boolean converterWinsContentType)
Set whether the content type set by a converter prevails or not.
|
void |
setExclusive(boolean exclusive)
Set if a single consumer in the container will have exclusive use of the
queues, preventing other consumers from receiving messages from the
queue(s).
|
void |
setGroup(String group)
Set the group for the corresponding listener container.
|
void |
setId(String id) |
void |
setMessageConverter(MessageConverter messageConverter)
The preferred way for a container factory to pass a message converter
to the endpoint's adapter.
|
void |
setPriority(Integer priority)
Set the priority of this endpoint.
|
void |
setQueueNames(String... queueNames)
Set the queue names to use.
|
void |
setQueues(Queue... queues)
Set the queues to use.
|
void |
setReplyContentType(String replyContentType)
Set the reply content type.
|
void |
setReplyPostProcessor(ReplyPostProcessor replyPostProcessor)
Set a
ReplyPostProcessor to post process a response message before it is sent. |
void |
setTaskExecutor(TaskExecutor taskExecutor)
Override the default task executor.
|
void |
setupListenerContainer(MessageListenerContainer listenerContainer)
Setup the specified message listener container with the model
defined by this endpoint.
|
String |
toString() |
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory in interface BeanFactoryAwareBeansException@Nullable protected BeanFactory getBeanFactory()
protected BeanExpressionResolver getResolver()
protected BeanResolver getBeanResolver()
protected BeanExpressionContext getBeanExpressionContext()
public void setId(String id)
public String getId()
getId in interface RabbitListenerEndpointRabbitListenerContainerFactory.createListenerContainer(org.springframework.amqp.rabbit.listener.RabbitListenerEndpoint)public void setQueues(Queue... queues)
Queue instances or the
queue names should be provided, but not both.queues - to set.setQueueNames(java.lang.String...)public Collection<Queue> getQueues()
public Collection<String> getQueueNames()
public void setQueueNames(String... queueNames)
Queue instances or the
queue names should be provided, but not both.queueNames - to set.setQueues(org.springframework.amqp.core.Queue...)public void setExclusive(boolean exclusive)
exclusive - the exclusive boolean flag.public boolean isExclusive()
boolean flag.public void setPriority(Integer priority)
priority - the priority value.public Integer getPriority()
null if
no priority is set.public void setConcurrency(String concurrency)
concurrency - the concurrency.public String getConcurrency()
getConcurrency in interface RabbitListenerEndpointpublic void setAdmin(AmqpAdmin admin)
AmqpAdmin instance to use.admin - the AmqpAdmin instance.public AmqpAdmin getAdmin()
AmqpAdmin instance to use or null if
none is configured.public String getGroup()
getGroup in interface RabbitListenerEndpointpublic void setGroup(String group)
group - the group.public void setAutoStartup(Boolean autoStartup)
autoStartup - the autoStartup.public Boolean getAutoStartup()
RabbitListenerEndpointgetAutoStartup in interface RabbitListenerEndpointpublic MessageConverter getMessageConverter()
RabbitListenerEndpointgetMessageConverter in interface RabbitListenerEndpointpublic void setMessageConverter(MessageConverter messageConverter)
RabbitListenerEndpointsetMessageConverter in interface RabbitListenerEndpointmessageConverter - the converter.public TaskExecutor getTaskExecutor()
RabbitListenerEndpointgetTaskExecutor in interface RabbitListenerEndpointpublic void setTaskExecutor(TaskExecutor taskExecutor)
taskExecutor - the executor.public boolean isBatchListener()
public void setBatchListener(boolean batchListener)
setBatchListener in interface RabbitListenerEndpointbatchListener - true for a batch listener.setBatchingStrategy(BatchingStrategy)@Nullable public BatchingStrategy getBatchingStrategy()
public void setBatchingStrategy(BatchingStrategy batchingStrategy)
RabbitListenerEndpointBatchingStrategy to use when debatching messages.setBatchingStrategy in interface RabbitListenerEndpointbatchingStrategy - the batching strategy.RabbitListenerEndpoint.setBatchListener(boolean)@Nullable public AcknowledgeMode getAckMode()
RabbitListenerEndpointAcknowledgeMode.getAckMode in interface RabbitListenerEndpointpublic void setAckMode(AcknowledgeMode mode)
public ReplyPostProcessor getReplyPostProcessor()
RabbitListenerEndpointReplyPostProcessor to post process a reply message before it is
sent.getReplyPostProcessor in interface RabbitListenerEndpointpublic void setReplyPostProcessor(ReplyPostProcessor replyPostProcessor)
ReplyPostProcessor to post process a response message before it is sent.replyPostProcessor - the post processor.public String getReplyContentType()
RabbitListenerEndpointgetReplyContentType in interface RabbitListenerEndpointpublic void setReplyContentType(String replyContentType)
replyContentType - the content type.public boolean isConverterWinsContentType()
RabbitListenerEndpointisConverterWinsContentType in interface RabbitListenerEndpointpublic void setConverterWinsContentType(boolean converterWinsContentType)
converterWinsContentType - false to always apply the reply content type.public void setupListenerContainer(MessageListenerContainer listenerContainer)
RabbitListenerEndpointThis endpoint must provide the requested missing option(s) of
the specified container to make it usable. Usually, this is about
setting the queues and the messageListener to
use but an implementation may override any default setting that
was already set.
setupListenerContainer in interface RabbitListenerEndpointlistenerContainer - the listener container to configureprotected abstract MessageListener createMessageListener(MessageListenerContainer container)
MessageListener that is able to serve this endpoint for the
specified container.container - the MessageListenerContainer to create a MessageListener.MessageListener instance.protected StringBuilder getEndpointDescription()
Available to subclasses, for inclusion in their toString() result.