org.springframework.integration.amqp.channel
Class PublishSubscribeAmqpChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.amqp.channel.AbstractAmqpChannel
org.springframework.integration.amqp.channel.PublishSubscribeAmqpChannel
- All Implemented Interfaces:
- org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, NamedComponent, SubscribableChannel, TrackableComponent, MessageChannel
public class PublishSubscribeAmqpChannel
- extends AbstractAmqpChannel
- Since:
- 2.1
- Author:
- Mark Fisher, Gary Russell
Constructor Summary |
PublishSubscribeAmqpChannel(java.lang.String channelName,
org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer container,
org.springframework.amqp.core.AmqpTemplate amqpTemplate)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PublishSubscribeAmqpChannel
public PublishSubscribeAmqpChannel(java.lang.String channelName,
org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer container,
org.springframework.amqp.core.AmqpTemplate amqpTemplate)
setExchange
public void setExchange(org.springframework.amqp.core.FanoutExchange exchange)
- Configure the FanoutExchange instance. If this is not provided, then a
FanoutExchange will be declared implicitly, and its name will be the same
as the channel name prefixed by "si.fanout.". In either case, an effectively
anonymous Queue will be declared automatically.
initializeQueue
protected org.springframework.amqp.core.Queue initializeQueue(org.springframework.amqp.core.AmqpAdmin admin,
java.lang.String channelName)
createDispatcher
protected MessageDispatcher createDispatcher()
getExchangeName
protected java.lang.String getExchangeName()
- Description copied from class:
AbstractAmqpChannel
- Subclasses may override this method to return an Exchange name.
By default, Messages will be sent to the no-name Direct Exchange.
- Overrides:
getExchangeName
in class AbstractAmqpChannel
subscribe
public boolean subscribe(MessageHandler handler)
- Description copied from interface:
SubscribableChannel
- Register a
MessageHandler
as a subscriber to this channel.
- Specified by:
subscribe
in interface SubscribableChannel
unsubscribe
public boolean unsubscribe(MessageHandler handler)
- Description copied from interface:
SubscribableChannel
- Remove a
MessageHandler
from the subscribers of this channel.
- Specified by:
unsubscribe
in interface SubscribableChannel
onInit
public void onInit()
throws java.lang.Exception
- Description copied from class:
IntegrationObjectSupport
- Subclasses may implement this for initialization logic.
- Overrides:
onInit
in class IntegrationObjectSupport
- Throws:
java.lang.Exception
isAutoStartup
public boolean isAutoStartup()
- Specified by:
isAutoStartup
in interface org.springframework.context.SmartLifecycle
getPhase
public int getPhase()
- Specified by:
getPhase
in interface org.springframework.context.Phased
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interface org.springframework.context.Lifecycle
start
public void start()
- Specified by:
start
in interface org.springframework.context.Lifecycle
stop
public void stop()
- Specified by:
stop
in interface org.springframework.context.Lifecycle
stop
public void stop(java.lang.Runnable callback)
- Specified by:
stop
in interface org.springframework.context.SmartLifecycle
destroy
public void destroy()
throws java.lang.Exception
- Specified by:
destroy
in interface org.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception