public class PublishSubscribeAmqpChannel extends AbstractAmqpChannel implements org.springframework.amqp.rabbit.connection.ConnectionListener
Constructor and Description |
---|
PublishSubscribeAmqpChannel(java.lang.String channelName,
org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer container,
org.springframework.amqp.core.AmqpTemplate amqpTemplate) |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.integration.dispatcher.AbstractDispatcher |
createDispatcher() |
void |
destroy() |
protected org.springframework.amqp.core.AmqpAdmin |
getAdmin() |
protected org.springframework.amqp.rabbit.connection.ConnectionFactory |
getConnectionFactory() |
protected java.lang.String |
getExchangeName()
Subclasses may override this method to return an Exchange name.
|
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
protected java.lang.String |
obtainQueueName(org.springframework.amqp.core.AmqpAdmin admin,
java.lang.String channelName) |
void |
onClose(org.springframework.amqp.rabbit.connection.Connection connection) |
void |
onCreate(org.springframework.amqp.rabbit.connection.Connection connection) |
void |
onInit() |
void |
setExchange(org.springframework.amqp.core.FanoutExchange exchange)
Configure the FanoutExchange instance.
|
void |
setMaxSubscribers(int maxSubscribers)
Specify the maximum number of subscribers supported by the
channel's dispatcher (if it is an
AbstractDispatcher ). |
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
boolean |
subscribe(org.springframework.messaging.MessageHandler handler) |
boolean |
unsubscribe(org.springframework.messaging.MessageHandler handler) |
doSend, getRoutingKey
addInterceptor, addInterceptor, getChannelInterceptors, getComponentType, getFullChannelName, getInterceptors, removeInterceptor, removeInterceptor, send, send, setConversionService, setDatatypes, setInterceptors, setMessageConverter, setShouldTrack
afterPropertiesSet, getApplicationContext, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setMessageBuilderFactory, setTaskScheduler, toString
public PublishSubscribeAmqpChannel(java.lang.String channelName, org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer container, org.springframework.amqp.core.AmqpTemplate amqpTemplate)
public void setExchange(org.springframework.amqp.core.FanoutExchange exchange)
exchange
- The fanout exchange.protected java.lang.String obtainQueueName(org.springframework.amqp.core.AmqpAdmin admin, java.lang.String channelName)
protected org.springframework.integration.dispatcher.AbstractDispatcher createDispatcher()
protected java.lang.String getExchangeName()
AbstractAmqpChannel
getExchangeName
in class AbstractAmqpChannel
public void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
public void start()
start
in interface org.springframework.context.Lifecycle
public void onCreate(org.springframework.amqp.rabbit.connection.Connection connection)
onCreate
in interface org.springframework.amqp.rabbit.connection.ConnectionListener
public void onClose(org.springframework.amqp.rabbit.connection.Connection connection)
onClose
in interface org.springframework.amqp.rabbit.connection.ConnectionListener
public void setMaxSubscribers(int maxSubscribers)
AbstractDispatcher
).maxSubscribers
- The maximum number of subscribers allowed.protected org.springframework.amqp.core.AmqpAdmin getAdmin()
protected org.springframework.amqp.rabbit.connection.ConnectionFactory getConnectionFactory()
public boolean subscribe(org.springframework.messaging.MessageHandler handler)
subscribe
in interface org.springframework.messaging.SubscribableChannel
public boolean unsubscribe(org.springframework.messaging.MessageHandler handler)
unsubscribe
in interface org.springframework.messaging.SubscribableChannel
public void onInit() throws java.lang.Exception
onInit
in class org.springframework.integration.channel.AbstractMessageChannel
java.lang.Exception
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public void stop(java.lang.Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle