public class PublishSubscribeAmqpChannel extends AbstractAmqpChannel implements ConnectionListener
AbstractMessageChannel.ChannelInterceptorListinterceptorsEXPRESSION_PARSER, loggerINDEFINITE_TIMEOUT| Constructor and Description |
|---|
PublishSubscribeAmqpChannel(String channelName,
SimpleMessageListenerContainer container,
AmqpTemplate amqpTemplate)
Construct an instance with the supplied name, container and template; default header
mappers will be used if the message is mapped.
|
PublishSubscribeAmqpChannel(String channelName,
SimpleMessageListenerContainer container,
AmqpTemplate amqpTemplate,
AmqpHeaderMapper outboundMapper,
AmqpHeaderMapper inboundMapper)
Construct an instance with the supplied name, container and template; default header
mappers will be used if the message is mapped.
|
| 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() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
protected String |
obtainQueueName(AmqpAdmin admin,
String channelName) |
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, getAmqpTemplate, getInboundHeaderMapper, getRabbitTemplate, getRoutingKey, isExtractPayload, isLoggingEnabled, setDefaultDeliveryMode, setExtractPayload, setLoggingEnabledaddInterceptor, addInterceptor, configureMetrics, getChannelInterceptors, getComponentType, getErrorRate, getFullChannelName, getInterceptors, getMaxSendDuration, getMeanErrorRate, getMeanErrorRatio, getMeanSendDuration, getMeanSendRate, getMetrics, getMinSendDuration, getSendCount, getSendCountLong, getSendDuration, getSendErrorCount, getSendErrorCountLong, getSendRate, getStandardDeviationSendDuration, getTimeSinceLastSend, isCountsEnabled, isStatsEnabled, removeInterceptor, removeInterceptor, reset, send, send, setCountsEnabled, setDatatypes, setInterceptors, setMessageConverter, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsend, sendgetComponentNamepublic PublishSubscribeAmqpChannel(String channelName, SimpleMessageListenerContainer container, AmqpTemplate amqpTemplate)
channelName - the channel name.container - the container.amqpTemplate - the template.AbstractAmqpChannel.setExtractPayload(boolean)public PublishSubscribeAmqpChannel(String channelName, SimpleMessageListenerContainer container, AmqpTemplate amqpTemplate, AmqpHeaderMapper outboundMapper, AmqpHeaderMapper inboundMapper)
channelName - the channel name.container - the container.amqpTemplate - the templateoutboundMapper - the outbound mapper.inboundMapper - the inbound mapper.AbstractAmqpChannel.setExtractPayload(boolean)public void setExchange(FanoutExchange exchange)
exchange - The fanout exchange.protected AbstractDispatcher createDispatcher()
protected String getExchangeName()
AbstractAmqpChannelgetExchangeName in class AbstractAmqpChannelpublic void destroy()
throws Exception
destroy in interface DisposableBeanExceptionpublic void onCreate(Connection connection)
onCreate in interface ConnectionListenerpublic void onClose(Connection connection)
onClose in interface ConnectionListenerpublic 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 SubscribableChannelpublic boolean unsubscribe(MessageHandler handler)
unsubscribe in interface SubscribableChannelpublic void onInit()
throws Exception
IntegrationObjectSupportonInit in class AbstractMessageChannelException - Any exception.public boolean isAutoStartup()
isAutoStartup in interface SmartLifecyclepublic void stop(Runnable callback)
stop in interface SmartLifecycle