Class PointToPointSubscribableAmqpChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.amqp.channel.AbstractAmqpChannel
org.springframework.integration.amqp.channel.PointToPointSubscribableAmqpChannel
- All Implemented Interfaces:
org.springframework.amqp.rabbit.connection.ConnectionListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,org.springframework.integration.context.ExpressionCapable,org.springframework.integration.IntegrationPattern,org.springframework.integration.support.context.NamedComponent,org.springframework.integration.support.management.IntegrationManagement,org.springframework.integration.support.management.ManageableLifecycle,org.springframework.integration.support.management.ManageableSmartLifecycle,org.springframework.integration.support.management.TrackableComponent,org.springframework.messaging.MessageChannel,org.springframework.messaging.SubscribableChannel,org.springframework.messaging.support.InterceptableChannel
public class PointToPointSubscribableAmqpChannel extends AbstractAmqpChannel
- Since:
- 2.1
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.springframework.integration.channel.AbstractMessageChannel
interceptors, metersFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger -
Constructor Summary
Constructors Constructor Description PointToPointSubscribableAmqpChannel(java.lang.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.PointToPointSubscribableAmqpChannel(java.lang.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. -
Method Summary
Modifier and Type Method Description protected org.springframework.integration.dispatcher.AbstractDispatchercreateDispatcher()voiddestroy()protected voiddoDeclares()intgetPhase()protected java.lang.StringgetRoutingKey()Subclasses may override this method to return a routing key.booleanisAutoStartup()booleanisRunning()protected java.lang.StringobtainQueueName(java.lang.String channelName)voidonInit()voidsetMaxSubscribers(int maxSubscribers)Specify the maximum number of subscribers supported by the channel's dispatcher (if it is anAbstractDispatcher).voidsetQueueName(java.lang.String queueName)Provide a Queue name to be used.voidstart()voidstop()voidstop(java.lang.Runnable callback)booleansubscribe(org.springframework.messaging.MessageHandler handler)booleanunsubscribe(org.springframework.messaging.MessageHandler handler)Methods inherited from class org.springframework.integration.amqp.channel.AbstractAmqpChannel
doSend, getAdmin, getAmqpTemplate, getConnectionFactory, getExchangeName, getInboundHeaderMapper, getRabbitTemplate, isExtractPayload, isLoggingEnabled, onClose, onCreate, setAdmin, setConnectionFactory, setDefaultDeliveryMode, setExtractPayload, setHeadersMappedLast, setLoggingEnabledMethods inherited from class org.springframework.integration.channel.AbstractMessageChannel
addInterceptor, addInterceptor, getComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, registerMetricsCaptor, removeInterceptor, removeInterceptor, send, send, setDatatypes, setInterceptors, setMessageConverter, setShouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.amqp.rabbit.connection.ConnectionListener
onShutDown
-
Constructor Details
-
PointToPointSubscribableAmqpChannel
public PointToPointSubscribableAmqpChannel(java.lang.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.- Parameters:
channelName- the channel name.container- the container.amqpTemplate- the template.- See Also:
AbstractAmqpChannel.setExtractPayload(boolean)
-
PointToPointSubscribableAmqpChannel
public PointToPointSubscribableAmqpChannel(java.lang.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.- Parameters:
channelName- the channel name.container- the container.amqpTemplate- the template.outboundMapper- the outbound mapper.inboundMapper- the inbound mapper.- Since:
- 4.3
- See Also:
AbstractAmqpChannel.setExtractPayload(boolean)
-
-
Method Details
-
setQueueName
public void setQueueName(java.lang.String queueName)Provide a Queue name to be used. If this is not provided, the Queue's name will be the same as the channel name.- Parameters:
queueName- The queue name.
-
obtainQueueName
protected java.lang.String obtainQueueName(java.lang.String channelName) -
createDispatcher
protected org.springframework.integration.dispatcher.AbstractDispatcher createDispatcher() -
getRoutingKey
protected java.lang.String getRoutingKey()Description copied from class:AbstractAmqpChannelSubclasses may override this method to return a routing key. By default, there will be no routing key (empty string).- Overrides:
getRoutingKeyin classAbstractAmqpChannel- Returns:
- The routing key.
-
doDeclares
protected void doDeclares()- Specified by:
doDeclaresin classAbstractAmqpChannel
-
setMaxSubscribers
public void setMaxSubscribers(int maxSubscribers)Specify the maximum number of subscribers supported by the channel's dispatcher (if it is anAbstractDispatcher).- Parameters:
maxSubscribers- The maximum number of subscribers allowed.
-
subscribe
public boolean subscribe(org.springframework.messaging.MessageHandler handler)- Specified by:
subscribein interfaceorg.springframework.messaging.SubscribableChannel
-
unsubscribe
public boolean unsubscribe(org.springframework.messaging.MessageHandler handler)- Specified by:
unsubscribein interfaceorg.springframework.messaging.SubscribableChannel
-
onInit
public void onInit()- Overrides:
onInitin classAbstractAmqpChannel
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle- Specified by:
isRunningin interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Specified by:
startin interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle- Specified by:
stopin interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
stop
public void stop(java.lang.Runnable callback)- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Specified by:
destroyin interfaceorg.springframework.integration.support.management.IntegrationManagement- Overrides:
destroyin classAbstractAmqpChannel
-