public class PollableAmqpChannel extends AbstractAmqpChannel implements PollableChannel
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.ChannelInterceptorList
logger
Constructor and Description |
---|
PollableAmqpChannel(java.lang.String channelName,
org.springframework.amqp.core.AmqpTemplate amqpTemplate) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getRoutingKey()
Subclasses may override this method to return a routing key.
|
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
Message<?> |
receive()
Receive a message from this channel, blocking indefinitely if necessary.
|
Message<?> |
receive(long timeout)
Receive a message from this channel, blocking until either a message is
available or the specified timeout period elapses.
|
void |
setAmqpAdmin(org.springframework.amqp.core.AmqpAdmin amqpAdmin)
Provide an instance of AmqpAdmin for implicitly declaring Queues if the queueName is not provided.
|
void |
setQueueName(java.lang.String queueName)
Provide an explicitly configured queue name.
|
doSend, getExchangeName
addInterceptor, getComponentType, getFullChannelName, getInterceptors, send, send, setConversionService, setDatatypes, setInterceptors, setShouldTrack
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
send, send
getComponentName
public PollableAmqpChannel(java.lang.String channelName, org.springframework.amqp.core.AmqpTemplate amqpTemplate)
public void setQueueName(java.lang.String queueName)
public void setAmqpAdmin(org.springframework.amqp.core.AmqpAdmin amqpAdmin)
protected void onInit() throws java.lang.Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
java.lang.Exception
protected java.lang.String getRoutingKey()
AbstractAmqpChannel
getRoutingKey
in class AbstractAmqpChannel
public Message<?> receive()
PollableChannel
receive
in interface PollableChannel
Message
or null
if interruptedpublic Message<?> receive(long timeout)
PollableChannel
receive
in interface PollableChannel
timeout
- the timeout in millisecondsMessage
or null
if the
specified timeout period elapses or the message reception is interrupted