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.ChannelInterceptorListIntegrationManagement.ManagementOverridesinterceptors, metersEXPRESSION_PARSER, loggerINDEFINITE_TIMEOUTMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME| 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 void |
doDeclares() |
protected Message<?> |
doReceive(Long timeout) |
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.
|
protected Object |
performReceive(Long timeout) |
Message<?> |
receive() |
Message<?> |
receive(long timeout) |
boolean |
removeInterceptor(ChannelInterceptor interceptor) |
ChannelInterceptor |
removeInterceptor(int 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.
|
destroy, doSend, getAdmin, getAmqpTemplate, getConnectionFactory, getExchangeName, getInboundHeaderMapper, getRabbitTemplate, isExtractPayload, isLoggingEnabled, onClose, onCreate, setAdmin, setConnectionFactory, setDefaultDeliveryMode, setExtractPayload, setHeadersMappedLast, setLoggingEnabledconfigureMetrics, getComponentType, getErrorRate, getFullChannelName, getIChannelInterceptorList, getInterceptors, getMaxSendDuration, getMeanErrorRate, getMeanErrorRatio, getMeanSendDuration, getMeanSendRate, getMetrics, getMetricsCaptor, getMinSendDuration, getOverrides, getSendCount, getSendCountLong, getSendDuration, getSendErrorCount, getSendErrorCountLong, getSendRate, getStandardDeviationSendDuration, getTimeSinceLastSend, isCountsEnabled, isStatsEnabled, registerMetricsCaptor, reset, send, send, setCountsEnabled, setDatatypes, setMessageConverter, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsend, sendreceiveCount, receiveErrorCountisStatsEnabled, setStatsEnableddestroy, getOverrides, isCountsEnabled, isLoggingEnabled, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabledgetChannelInterceptorsgetInterceptorsonShutDowngetBeanName, getComponentNamesendCount, sendErrorCountpublic 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()
IntegrationObjectSupportonInit in class AbstractAmqpChannelprotected void doDeclares()
doDeclares in class AbstractAmqpChannel@Nullable public Message<?> receive()
receive in interface PollableChannel@Nullable public Message<?> receive(long timeout)
receive in interface PollableChannelpublic void setInterceptors(List<ChannelInterceptor> interceptors)
AbstractMessageChannelsetInterceptors in interface InterceptableChannelsetInterceptors in class AbstractMessageChannelinterceptors - The list of interceptors.public void addInterceptor(ChannelInterceptor interceptor)
AbstractMessageChanneladdInterceptor in interface InterceptableChanneladdInterceptor in class AbstractMessageChannelinterceptor - The interceptor.public void addInterceptor(int index,
ChannelInterceptor interceptor)
AbstractMessageChanneladdInterceptor in interface InterceptableChanneladdInterceptor in class AbstractMessageChannelindex - The index to add interceptor.interceptor - The interceptor.public boolean removeInterceptor(ChannelInterceptor interceptor)
removeInterceptor in interface InterceptableChannelremoveInterceptor in class AbstractMessageChannel@Nullable public ChannelInterceptor removeInterceptor(int index)
removeInterceptor in interface InterceptableChannelremoveInterceptor in class AbstractMessageChannelpublic boolean hasExecutorInterceptors()
hasExecutorInterceptors in interface ExecutorChannelInterceptorAware