public class PublishSubscribeAmqpChannel extends AbstractAmqpChannel implements BroadcastCapableChannel
AbstractSubscribableAmqpChannel
extension for pub-sub semantics based on the FanoutExchange
.AbstractMessageChannel.ChannelInterceptorList
IntegrationManagement.ManagementOverrides
interceptors, meters
EXPRESSION_PARSER, logger
INDEFINITE_TIMEOUT
DEFAULT_PHASE
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
PublishSubscribeAmqpChannel(String channelName,
org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer container,
org.springframework.amqp.core.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,
org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer container,
org.springframework.amqp.core.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 void |
doDeclares() |
protected String |
getExchangeName()
Subclasses may override this method to return an Exchange name.
|
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
protected String |
obtainQueueName(String channelName) |
void |
onInit()
Subclasses may implement this for initialization logic.
|
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(Runnable callback) |
boolean |
subscribe(MessageHandler handler) |
boolean |
unsubscribe(MessageHandler handler) |
doSend, getAdmin, getAmqpTemplate, getConnectionFactory, getInboundHeaderMapper, getRabbitTemplate, getRoutingKey, isExtractPayload, isLoggingEnabled, onClose, onCreate, setAdmin, setConnectionFactory, setDefaultDeliveryMode, setExtractPayload, setHeadersMappedLast, setLoggingEnabled
addInterceptor, addInterceptor, getComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, registerMetricsCaptor, removeInterceptor, removeInterceptor, send, send, setDatatypes, setInterceptors, setMessageConverter, setShouldTrack
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isBroadcast
subscribe, unsubscribe
send, send
onFailed, onShutDown
getManagedName, getManagedType, getThisAs, setManagedName, setManagedType
getBeanName, getComponentName
public PublishSubscribeAmqpChannel(String channelName, org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer container, org.springframework.amqp.core.AmqpTemplate amqpTemplate)
channelName
- the channel name.container
- the container.amqpTemplate
- the template.AbstractAmqpChannel.setExtractPayload(boolean)
public PublishSubscribeAmqpChannel(String channelName, org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer container, org.springframework.amqp.core.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(org.springframework.amqp.core.FanoutExchange exchange)
exchange
- The fanout exchange.protected String getExchangeName()
AbstractAmqpChannel
getExchangeName
in class AbstractAmqpChannel
protected AbstractDispatcher createDispatcher()
protected void doDeclares()
doDeclares
in class AbstractAmqpChannel
public void setMaxSubscribers(int maxSubscribers)
AbstractDispatcher
).maxSubscribers
- The maximum number of subscribers allowed.public boolean subscribe(MessageHandler handler)
subscribe
in interface SubscribableChannel
public boolean unsubscribe(MessageHandler handler)
unsubscribe
in interface SubscribableChannel
public void onInit()
IntegrationObjectSupport
onInit
in class AbstractAmqpChannel
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public int getPhase()
getPhase
in interface Phased
getPhase
in interface SmartLifecycle
public boolean isRunning()
isRunning
in interface Lifecycle
isRunning
in interface ManageableLifecycle
public void start()
start
in interface Lifecycle
start
in interface ManageableLifecycle
public void stop()
stop
in interface Lifecycle
stop
in interface ManageableLifecycle
public void stop(Runnable callback)
stop
in interface SmartLifecycle
public void destroy()
destroy
in interface DisposableBean
destroy
in interface IntegrationManagement
destroy
in class AbstractAmqpChannel