public class PollableAmqpChannel extends AbstractAmqpChannel implements PollableChannel, PollableChannelManagement, ExecutorChannelInterceptorAware
PollableChannel implementation that is backed by an AMQP Queue.
Messages will be sent to the default (no-name) exchange with that Queue's
name as the routing key.AbstractMessageChannel.ChannelInterceptorListinterceptorsEXPRESSION_PARSER, loggerINDEFINITE_TIMEOUT| Constructor and Description |
|---|
PollableAmqpChannel(String channelName,
AmqpTemplate amqpTemplate)
Construct an instance with the supplied name, template and default header mappers
used if the template is a
RabbitTemplate and the message is mapped. |
PollableAmqpChannel(String channelName,
AmqpTemplate amqpTemplate,
AmqpHeaderMapper outboundMapper,
AmqpHeaderMapper inboundMapper)
Construct an instance with the supplied name, template and header mappers.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInterceptor(ChannelInterceptor interceptor)
Add a channel interceptor to the end of the list.
|
void |
addInterceptor(int index,
ChannelInterceptor interceptor)
Add a channel interceptor to the specified index of the list.
|
protected Object |
doReceive() |
int |
getReceiveCount() |
long |
getReceiveCountLong() |
int |
getReceiveErrorCount() |
long |
getReceiveErrorCountLong() |
protected String |
getRoutingKey()
Subclasses may override this method to return a routing key.
|
boolean |
hasExecutorInterceptors() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
Message<?> |
receive() |
Message<?> |
receive(long timeout) |
boolean |
removeInterceptor(ChannelInterceptor interceptor)
Remove the provided
ChannelInterceptor from the target implementation. |
ChannelInterceptor |
removeInterceptor(int index)
Remove a
ChannelInterceptor from the target implementation for specific index. |
void |
setAmqpAdmin(AmqpAdmin amqpAdmin)
Provide an instance of AmqpAdmin for implicitly declaring Queues if the queueName is not provided.
|
void |
setInterceptors(List<ChannelInterceptor> interceptors)
Set the list of channel interceptors.
|
void |
setQueueName(String queueName)
Provide an explicitly configured queue name.
|
doSend, getAmqpTemplate, getExchangeName, getInboundHeaderMapper, getRabbitTemplate, isExtractPayload, isLoggingEnabled, setDefaultDeliveryMode, setExtractPayload, setLoggingEnabledconfigureMetrics, getChannelInterceptors, getComponentType, getErrorRate, getFullChannelName, getInterceptors, getMaxSendDuration, getMeanErrorRate, getMeanErrorRatio, getMeanSendDuration, getMeanSendRate, getMetrics, getMinSendDuration, getSendCount, getSendCountLong, getSendDuration, getSendErrorCount, getSendErrorCountLong, getSendRate, getStandardDeviationSendDuration, getTimeSinceLastSend, isCountsEnabled, isStatsEnabled, reset, send, send, setCountsEnabled, setDatatypes, setMessageConverter, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsend, sendgetErrorRate, getMaxSendDuration, getMeanErrorRate, getMeanErrorRatio, getMeanSendDuration, getMeanSendRate, getMinSendDuration, getSendCount, getSendCountLong, getSendDuration, getSendErrorCount, getSendErrorCountLong, getSendRate, getStandardDeviationSendDuration, getTimeSinceLastSendisStatsEnabled, setStatsEnabledisCountsEnabled, isLoggingEnabled, reset, setCountsEnabled, setLoggingEnabledgetChannelInterceptorsgetComponentNamepublic PollableAmqpChannel(String channelName, AmqpTemplate amqpTemplate)
RabbitTemplate and the message is mapped.channelName - the channel name.amqpTemplate - the template.AbstractAmqpChannel.setExtractPayload(boolean)public PollableAmqpChannel(String channelName, AmqpTemplate amqpTemplate, AmqpHeaderMapper outboundMapper, AmqpHeaderMapper inboundMapper)
channelName - the channel name.amqpTemplate - the template.outboundMapper - the outbound mapper.inboundMapper - the inbound mapper.AbstractAmqpChannel.setExtractPayload(boolean)public void setQueueName(String queueName)
queueName - The queue name.public void setAmqpAdmin(AmqpAdmin amqpAdmin)
amqpAdmin - The amqp admin.public int getReceiveCount()
getReceiveCount in interface PollableChannelManagementpublic long getReceiveCountLong()
getReceiveCountLong in interface PollableChannelManagementpublic int getReceiveErrorCount()
getReceiveErrorCount in interface PollableChannelManagementpublic long getReceiveErrorCountLong()
getReceiveErrorCountLong in interface PollableChannelManagementprotected String getRoutingKey()
AbstractAmqpChannelgetRoutingKey in class AbstractAmqpChannelprotected void onInit()
throws Exception
IntegrationObjectSupportonInit in class AbstractMessageChannelException - Any exception.public Message<?> receive()
receive in interface PollableChannelprotected Object doReceive()
public Message<?> receive(long timeout)
receive in interface PollableChannelpublic void setInterceptors(List<ChannelInterceptor> interceptors)
AbstractMessageChannelsetInterceptors in interface ChannelInterceptorAwaresetInterceptors in class AbstractMessageChannelinterceptors - The list of interceptors.public void addInterceptor(ChannelInterceptor interceptor)
AbstractMessageChanneladdInterceptor in interface ChannelInterceptorAwareaddInterceptor in class AbstractMessageChannelinterceptor - The interceptor.public void addInterceptor(int index,
ChannelInterceptor interceptor)
AbstractMessageChanneladdInterceptor in interface ChannelInterceptorAwareaddInterceptor in class AbstractMessageChannelindex - The index to add interceptor.interceptor - The interceptor.public boolean removeInterceptor(ChannelInterceptor interceptor)
ChannelInterceptorAwareChannelInterceptor from the target implementation.removeInterceptor in interface ChannelInterceptorAwareremoveInterceptor in class AbstractMessageChannelinterceptor - ChannelInterceptor to remove.boolean if ChannelInterceptor has been removed.public ChannelInterceptor removeInterceptor(int index)
ChannelInterceptorAwareChannelInterceptor from the target implementation for specific index.removeInterceptor in interface ChannelInterceptorAwareremoveInterceptor in class AbstractMessageChannelindex - the index for the ChannelInterceptor to remove.boolean if the ChannelInterceptor has been removed.public boolean hasExecutorInterceptors()
hasExecutorInterceptors in interface ExecutorChannelInterceptorAware