public class PublishSubscribeAmqpChannel extends AbstractAmqpChannel implements ConnectionListener
AbstractMessageChannel.ChannelInterceptorList
logger
INDEFINITE_TIMEOUT
Constructor and Description |
---|
PublishSubscribeAmqpChannel(String channelName,
SimpleMessageListenerContainer container,
AmqpTemplate amqpTemplate) |
Modifier and Type | Method and Description |
---|---|
protected AbstractDispatcher |
createDispatcher() |
void |
destroy() |
protected AmqpAdmin |
getAdmin() |
protected ConnectionFactory |
getConnectionFactory() |
protected String |
getExchangeName()
Subclasses may override this method to return an Exchange name.
|
int |
getPhase() |
protected Queue |
initializeQueue(AmqpAdmin admin,
String channelName) |
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
onClose(Connection connection) |
void |
onCreate(Connection connection) |
void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setExchange(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(Runnable callback) |
boolean |
subscribe(MessageHandler handler) |
boolean |
unsubscribe(MessageHandler handler) |
doSend, getRoutingKey
addInterceptor, addInterceptor, getChannelInterceptors, getComponentType, getFullChannelName, getInterceptors, send, send, setConversionService, setDatatypes, setInterceptors, setMessageConverter, setShouldTrack
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setMessageBuilderFactory, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
send, send
getComponentName
public PublishSubscribeAmqpChannel(String channelName, SimpleMessageListenerContainer container, AmqpTemplate amqpTemplate)
public void setExchange(FanoutExchange exchange)
exchange
- The fanout exchange.protected AbstractDispatcher createDispatcher()
protected String getExchangeName()
AbstractAmqpChannel
getExchangeName
in class AbstractAmqpChannel
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
public void onCreate(Connection connection)
onCreate
in interface ConnectionListener
public void onClose(Connection connection)
onClose
in interface ConnectionListener
public void setMaxSubscribers(int maxSubscribers)
AbstractDispatcher
).maxSubscribers
- The maximum number of subscribers allowed.protected AmqpAdmin getAdmin()
protected ConnectionFactory getConnectionFactory()
public boolean subscribe(MessageHandler handler)
subscribe
in interface SubscribableChannel
public boolean unsubscribe(MessageHandler handler)
unsubscribe
in interface SubscribableChannel
public void onInit() throws Exception
IntegrationObjectSupport
onInit
in class AbstractMessageChannel
Exception
- Any exception.public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public void stop(Runnable callback)
stop
in interface SmartLifecycle