Class PollableAmqpChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.amqp.channel.AbstractAmqpChannel
org.springframework.integration.amqp.channel.PollableAmqpChannel
- All Implemented Interfaces:
- ConnectionListener,- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- ExecutorChannelInterceptorAware,- ExpressionCapable,- IntegrationPattern,- NamedComponent,- IntegrationManagement,- TrackableComponent,- MessageChannel,- PollableChannel,- InterceptableChannel
public class PollableAmqpChannel
extends AbstractAmqpChannel
implements PollableChannel, ExecutorChannelInterceptorAware
A 
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.- Since:
- 2.1
- Author:
- Mark Fisher, Artem Bilan, Gary Russell
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannelAbstractMessageChannel.ChannelInterceptorListNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.channel.AbstractMessageChannelinterceptors, metersFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.messaging.MessageChannelINDEFINITE_TIMEOUT
- 
Constructor SummaryConstructorsConstructorDescriptionPollableAmqpChannel(String channelName, AmqpTemplate amqpTemplate) Construct an instance with the supplied name, template and default header mappers used if the template is aRabbitTemplateand the message is mapped.PollableAmqpChannel(String channelName, AmqpTemplate amqpTemplate, AmqpHeaderMapper outboundMapper, AmqpHeaderMapper inboundMapper) Construct an instance with the supplied name, template and header mappers.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddInterceptor(int index, ChannelInterceptor interceptor) Add a channel interceptor to the specified index of the list.voidaddInterceptor(ChannelInterceptor interceptor) Add a channel interceptor to the end of the list.protected voidprotected Message<?>protected StringSubclasses may override this method to return a routing key.booleanprotected voidonInit()Subclasses may implement this for initialization logic.protected ObjectperformReceive(Long timeout) Message<?>receive()Message<?>receive(long timeout) removeInterceptor(int index) booleanremoveInterceptor(ChannelInterceptor interceptor) voidsetAmqpAdmin(AmqpAdmin amqpAdmin) Provide an instance of AmqpAdmin for implicitly declaring Queues if the queueName is not provided.voidsetInterceptors(List<ChannelInterceptor> interceptors) Set the list of channel interceptors.voidsetQueueName(String queueName) Provide an explicitly configured queue name.Methods inherited from class org.springframework.integration.amqp.channel.AbstractAmqpChanneldestroy, doSend, getAdmin, getAmqpTemplate, getConnectionFactory, getExchangeName, getInboundHeaderMapper, getRabbitTemplate, isExtractPayload, isLoggingEnabled, onCreate, setAdmin, setConnectionFactory, setDefaultDeliveryMode, setExtractPayload, setHeadersMappedLast, setLoggingEnabledMethods inherited from class org.springframework.integration.channel.AbstractMessageChannelgetComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, isObserved, registerMetricsCaptor, registerObservationRegistry, send, send, setDatatypes, setMessageConverter, setObservationConvention, setShouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.amqp.rabbit.connection.ConnectionListeneronClose, onFailed, onShutDownMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetManagedName, getManagedType, getThisAs, setManagedName, setManagedTypeMethods inherited from interface org.springframework.messaging.support.InterceptableChannelgetInterceptorsMethods inherited from interface org.springframework.messaging.MessageChannelsend, sendMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
PollableAmqpChannelConstruct an instance with the supplied name, template and default header mappers used if the template is aRabbitTemplateand the message is mapped.- Parameters:
- channelName- the channel name.
- amqpTemplate- the template.
- See Also:
 
- 
PollableAmqpChannelpublic PollableAmqpChannel(String channelName, AmqpTemplate amqpTemplate, AmqpHeaderMapper outboundMapper, AmqpHeaderMapper inboundMapper) Construct an instance with the supplied name, template and header mappers.- Parameters:
- channelName- the channel name.
- amqpTemplate- the template.
- outboundMapper- the outbound mapper.
- inboundMapper- the inbound mapper.
- Since:
- 4.3
- See Also:
 
 
- 
- 
Method Details- 
setQueueNameProvide an explicitly configured queue name. If this is not provided, then a Queue will be created implicitly with the channelName as its name. The implicit creation will require that either an AmqpAdmin instance has been provided or that the configured AmqpTemplate is an instance of RabbitTemplate.- Parameters:
- queueName- The queue name.
 
- 
setAmqpAdminProvide an instance of AmqpAdmin for implicitly declaring Queues if the queueName is not provided. When providing a RabbitTemplate implementation, this is not strictly necessary since a RabbitAdmin instance can be created from the template's ConnectionFactory reference.- Parameters:
- amqpAdmin- The amqp admin.
 
- 
getRoutingKeyDescription copied from class:AbstractAmqpChannelSubclasses may override this method to return a routing key. By default, there will be no routing key (empty string).- Overrides:
- getRoutingKeyin class- AbstractAmqpChannel
- Returns:
- The routing key.
 
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- AbstractAmqpChannel
 
- 
doDeclaresprotected void doDeclares()- Specified by:
- doDeclaresin class- AbstractAmqpChannel
 
- 
receive- Specified by:
- receivein interface- PollableChannel
 
- 
receive- Specified by:
- receivein interface- PollableChannel
 
- 
doReceive
- 
performReceive
- 
setInterceptorsDescription copied from class:AbstractMessageChannelSet the list of channel interceptors. This will clear any existing interceptors.- Specified by:
- setInterceptorsin interface- InterceptableChannel
- Overrides:
- setInterceptorsin class- AbstractMessageChannel
- Parameters:
- interceptors- The list of interceptors.
 
- 
addInterceptorDescription copied from class:AbstractMessageChannelAdd a channel interceptor to the end of the list.- Specified by:
- addInterceptorin interface- InterceptableChannel
- Overrides:
- addInterceptorin class- AbstractMessageChannel
- Parameters:
- interceptor- The interceptor.
 
- 
addInterceptorDescription copied from class:AbstractMessageChannelAdd a channel interceptor to the specified index of the list.- Specified by:
- addInterceptorin interface- InterceptableChannel
- Overrides:
- addInterceptorin class- AbstractMessageChannel
- Parameters:
- index- The index to add interceptor.
- interceptor- The interceptor.
 
- 
removeInterceptor- Specified by:
- removeInterceptorin interface- InterceptableChannel
- Overrides:
- removeInterceptorin class- AbstractMessageChannel
 
- 
removeInterceptor- Specified by:
- removeInterceptorin interface- InterceptableChannel
- Overrides:
- removeInterceptorin class- AbstractMessageChannel
 
- 
hasExecutorInterceptorspublic boolean hasExecutorInterceptors()- Specified by:
- hasExecutorInterceptorsin interface- ExecutorChannelInterceptorAware
 
 
-