public class PollableAmqpChannel extends AbstractAmqpChannel implements org.springframework.messaging.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.ManagementOverridesinterceptorsEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME| Constructor and Description |
|---|
PollableAmqpChannel(java.lang.String channelName,
org.springframework.amqp.core.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(java.lang.String channelName,
org.springframework.amqp.core.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(org.springframework.messaging.support.ChannelInterceptor interceptor)
Add a channel interceptor to the end of the list.
|
void |
addInterceptor(int index,
org.springframework.messaging.support.ChannelInterceptor interceptor)
Add a channel interceptor to the specified index of the list.
|
protected void |
doDeclares() |
protected org.springframework.messaging.Message<?> |
doReceive(java.lang.Long timeout) |
int |
getReceiveCount() |
long |
getReceiveCountLong() |
int |
getReceiveErrorCount() |
long |
getReceiveErrorCountLong() |
protected java.lang.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 java.lang.Object |
performReceive(java.lang.Long timeout) |
org.springframework.messaging.Message<?> |
receive() |
org.springframework.messaging.Message<?> |
receive(long timeout) |
boolean |
removeInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
Remove the provided
ChannelInterceptor from the target implementation. |
org.springframework.messaging.support.ChannelInterceptor |
removeInterceptor(int index)
Remove a
ChannelInterceptor from the target implementation for specific index. |
void |
setAmqpAdmin(org.springframework.amqp.core.AmqpAdmin amqpAdmin)
Provide an instance of AmqpAdmin for implicitly declaring Queues if the queueName is not provided.
|
void |
setInterceptors(java.util.List<org.springframework.messaging.support.ChannelInterceptor> interceptors)
Set the list of channel interceptors.
|
void |
setQueueName(java.lang.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, getChannelInterceptors, getComponentType, getErrorRate, getFullChannelName, 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, getApplicationContext, getApplicationContextId, getBeanFactory, 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, waitgetErrorRate, getMaxSendDuration, getMeanErrorRate, getMeanErrorRatio, getMeanSendDuration, getMeanSendRate, getMinSendDuration, getSendCount, getSendCountLong, getSendDuration, getSendErrorCount, getSendErrorCountLong, getSendRate, getStandardDeviationSendDuration, getTimeSinceLastSendisStatsEnabled, setStatsEnabledgetOverrides, isCountsEnabled, isLoggingEnabled, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabledgetChannelInterceptorsonShutDowngetComponentNamepublic PollableAmqpChannel(java.lang.String channelName,
org.springframework.amqp.core.AmqpTemplate amqpTemplate)
RabbitTemplate and the message is mapped.channelName - the channel name.amqpTemplate - the template.AbstractAmqpChannel.setExtractPayload(boolean)public PollableAmqpChannel(java.lang.String channelName,
org.springframework.amqp.core.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(java.lang.String queueName)
queueName - The queue name.public void setAmqpAdmin(org.springframework.amqp.core.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 java.lang.String getRoutingKey()
AbstractAmqpChannelgetRoutingKey in class AbstractAmqpChannelprotected void onInit()
throws java.lang.Exception
IntegrationObjectSupportonInit in class AbstractAmqpChanneljava.lang.Exception - Any exception.protected void doDeclares()
doDeclares in class AbstractAmqpChannelpublic org.springframework.messaging.Message<?> receive()
receive in interface org.springframework.messaging.PollableChannelpublic org.springframework.messaging.Message<?> receive(long timeout)
receive in interface org.springframework.messaging.PollableChannelprotected org.springframework.messaging.Message<?> doReceive(java.lang.Long timeout)
protected java.lang.Object performReceive(java.lang.Long timeout)
public void setInterceptors(java.util.List<org.springframework.messaging.support.ChannelInterceptor> interceptors)
AbstractMessageChannelsetInterceptors in interface ChannelInterceptorAwaresetInterceptors in class AbstractMessageChannelinterceptors - The list of interceptors.public void addInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
AbstractMessageChanneladdInterceptor in interface ChannelInterceptorAwareaddInterceptor in class AbstractMessageChannelinterceptor - The interceptor.public void addInterceptor(int index,
org.springframework.messaging.support.ChannelInterceptor interceptor)
AbstractMessageChanneladdInterceptor in interface ChannelInterceptorAwareaddInterceptor in class AbstractMessageChannelindex - The index to add interceptor.interceptor - The interceptor.public boolean removeInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
ChannelInterceptorAwareChannelInterceptor from the target implementation.removeInterceptor in interface ChannelInterceptorAwareremoveInterceptor in class AbstractMessageChannelinterceptor - ChannelInterceptor to remove.boolean if ChannelInterceptor has been removed.public org.springframework.messaging.support.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