org.springframework.integration.amqp.channel
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:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.integration.context.NamedComponent, org.springframework.integration.core.PollableChannel, org.springframework.integration.history.TrackableComponent, org.springframework.integration.MessageChannel
public class PollableAmqpChannel
- extends AbstractAmqpChannel
- implements org.springframework.integration.core.PollableChannel
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
| Nested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannel |
org.springframework.integration.channel.AbstractMessageChannel.ChannelInterceptorList |
| Fields inherited from class org.springframework.integration.channel.AbstractMessageChannel |
logger |
|
Constructor Summary |
PollableAmqpChannel(java.lang.String channelName,
org.springframework.amqp.core.AmqpTemplate amqpTemplate)
|
|
Method Summary |
protected java.lang.String |
getRoutingKey()
Subclasses may override this method to return a routing key. |
protected void |
onInit()
|
org.springframework.integration.Message<?> |
receive()
|
org.springframework.integration.Message<?> |
receive(long timeout)
|
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. |
| Methods inherited from class org.springframework.integration.channel.AbstractMessageChannel |
addInterceptor, getComponentType, getInterceptors, send, send, setConversionService, setDatatypes, setInterceptors, setShouldTrack |
| Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setTaskScheduler, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.springframework.integration.MessageChannel |
send, send |
| Methods inherited from interface org.springframework.integration.context.NamedComponent |
getComponentName |
PollableAmqpChannel
public PollableAmqpChannel(java.lang.String channelName,
org.springframework.amqp.core.AmqpTemplate amqpTemplate)
setQueueName
public void setQueueName(java.lang.String queueName)
- Provide 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.
setAmqpAdmin
public void setAmqpAdmin(org.springframework.amqp.core.AmqpAdmin amqpAdmin)
- Provide 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.
onInit
protected void onInit()
throws java.lang.Exception
- Overrides:
onInit in class org.springframework.integration.context.IntegrationObjectSupport
- Throws:
java.lang.Exception
getRoutingKey
protected java.lang.String getRoutingKey()
- Description copied from class:
AbstractAmqpChannel
- Subclasses may override this method to return a routing key.
By default, there will be no routing key (empty string).
- Overrides:
getRoutingKey in class AbstractAmqpChannel
receive
public org.springframework.integration.Message<?> receive()
- Specified by:
receive in interface org.springframework.integration.core.PollableChannel
receive
public org.springframework.integration.Message<?> receive(long timeout)
- Specified by:
receive in interface org.springframework.integration.core.PollableChannel