Class RabbitMessageChannelBinder
- java.lang.Object
-
- org.springframework.cloud.stream.binder.AbstractBinder<org.springframework.messaging.MessageChannel,C,P>
-
- org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<ExtendedConsumerProperties<RabbitConsumerProperties>,ExtendedProducerProperties<RabbitProducerProperties>,RabbitExchangeQueueProvisioner>
-
- org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,Binder<org.springframework.messaging.MessageChannel,ExtendedConsumerProperties<RabbitConsumerProperties>,ExtendedProducerProperties<RabbitProducerProperties>>,ExtendedBindingProperties<RabbitConsumerProperties,RabbitProducerProperties>,ExtendedPropertiesBinder<org.springframework.messaging.MessageChannel,RabbitConsumerProperties,RabbitProducerProperties>,PollableConsumerBinder<org.springframework.messaging.MessageHandler,ExtendedConsumerProperties<RabbitConsumerProperties>>,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationEventPublisherAware
public class RabbitMessageChannelBinder extends AbstractMessageChannelBinder<ExtendedConsumerProperties<RabbitConsumerProperties>,ExtendedProducerProperties<RabbitProducerProperties>,RabbitExchangeQueueProvisioner> implements ExtendedPropertiesBinder<org.springframework.messaging.MessageChannel,RabbitConsumerProperties,RabbitProducerProperties>, org.springframework.beans.factory.DisposableBean
ABinderimplementation backed by RabbitMQ.- Author:
- Mark Fisher, Gary Russell, Jennifer Hickey, Gunnar Hillert, Ilayaperumal Gopinathan, David Turanski, Marius Bogoevici, Artem Bilan, Soby Chacko, Oleg Zhurakousky, Christian Tzolov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder
AbstractMessageChannelBinder.ErrorInfrastructure, AbstractMessageChannelBinder.PolledConsumerResources
-
-
Field Summary
-
Fields inherited from class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder
provisioningProvider
-
Fields inherited from class org.springframework.cloud.stream.binder.AbstractBinder
logger
-
-
Constructor Summary
Constructors Constructor Description RabbitMessageChannelBinder(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory, org.springframework.boot.autoconfigure.amqp.RabbitProperties rabbitProperties, RabbitExchangeQueueProvisioner provisioningProvider)RabbitMessageChannelBinder(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory, org.springframework.boot.autoconfigure.amqp.RabbitProperties rabbitProperties, RabbitExchangeQueueProvisioner provisioningProvider, ListenerContainerCustomizer<org.springframework.amqp.rabbit.listener.MessageListenerContainer> containerCustomizer)RabbitMessageChannelBinder(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory, org.springframework.boot.autoconfigure.amqp.RabbitProperties rabbitProperties, RabbitExchangeQueueProvisioner provisioningProvider, ListenerContainerCustomizer<org.springframework.amqp.rabbit.listener.MessageListenerContainer> containerCustomizer, MessageSourceCustomizer<org.springframework.integration.amqp.inbound.AmqpMessageSource> sourceCustomizer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterUnbindConsumer(ConsumerDestination consumerDestination, String group, ExtendedConsumerProperties<RabbitConsumerProperties> consumerProperties)protected voidafterUnbindProducer(ProducerDestination destination, ExtendedProducerProperties<RabbitProducerProperties> producerProperties)protected org.springframework.integration.core.MessageProducercreateConsumerEndpoint(ConsumerDestination consumerDestination, String group, ExtendedConsumerProperties<RabbitConsumerProperties> properties)protected AbstractMessageChannelBinder.PolledConsumerResourcescreatePolledConsumerResources(String name, String group, ConsumerDestination destination, ExtendedConsumerProperties<RabbitConsumerProperties> consumerProperties)protected org.springframework.messaging.MessageHandlercreateProducerMessageHandler(ProducerDestination producerDestination, ExtendedProducerProperties<RabbitProducerProperties> producerProperties, org.springframework.messaging.MessageChannel errorChannel)voiddestroy()protected StringerrorsBaseName(ConsumerDestination destination, String group, ExtendedConsumerProperties<RabbitConsumerProperties> consumerProperties)org.springframework.amqp.rabbit.connection.ConnectionFactorygetConnectionFactory()Get the underlyingConnectionFactoryinstance to allow manually altering the connection lifecycle.StringgetDefaultsPrefix()protected org.springframework.messaging.MessageHandlergetErrorMessageHandler(ConsumerDestination destination, String group, ExtendedConsumerProperties<RabbitConsumerProperties> properties)protected org.springframework.integration.support.ErrorMessageStrategygetErrorMessageStrategy()RabbitConsumerPropertiesgetExtendedConsumerProperties(String channelName)RabbitProducerPropertiesgetExtendedProducerProperties(String channelName)Class<? extends BinderSpecificPropertiesProvider>getExtendedPropertiesEntryClass()protected org.springframework.messaging.MessageHandlergetPolledConsumerErrorMessageHandler(ConsumerDestination destination, String group, ExtendedConsumerProperties<RabbitConsumerProperties> properties)voidonInit()protected voidpostProcessOutputChannel(org.springframework.messaging.MessageChannel outputChannel, ExtendedProducerProperties<RabbitProducerProperties> producerProperties)protected voidpostProcessPollableSource(DefaultPollableMessageSource bindingTarget)voidsetAdminAddresses(String[] adminAddresses)voidsetCompressingPostProcessor(org.springframework.amqp.core.MessagePostProcessor compressingPostProcessor)Set aMessagePostProcessorto compress messages.voidsetDecompressingPostProcessor(org.springframework.amqp.core.MessagePostProcessor decompressingPostProcessor)Set aMessagePostProcessorto decompress messages.voidsetExtendedBindingProperties(RabbitExtendedBindingProperties extendedBindingProperties)voidsetNodes(String[] nodes)-
Methods inherited from class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder
bindPollableConsumer, createProducerMessageHandler, doBindConsumer, doBindProducer, errorsBaseName, getApplicationEventPublisher, getContainerCustomizer, getDefaultErrorMessageHandler, getErrorBridgeName, getErrorBridgeName, getErrorMessageHandlerName, getErrorRecovererName, getMessageSourceCustomizer, getPolledConsumerRecoveryCallback, registerErrorInfrastructure, registerErrorInfrastructure, setApplicationEventPublisher, setConsumerEndpointCustomizer, setProducerMessageHandlerCustomizer, useNativeEncoding
-
Methods inherited from class org.springframework.cloud.stream.binder.AbstractBinder
afterPropertiesSet, applyPrefix, bindConsumer, bindProducer, buildRetryTemplate, constructDLQName, getApplicationContext, getBeanFactory, getEvaluationContext, groupedName, setApplicationContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.cloud.stream.binder.Binder
bindConsumer, bindProducer
-
Methods inherited from interface org.springframework.cloud.stream.binder.ExtendedBindingProperties
getBindings
-
-
-
-
Constructor Detail
-
RabbitMessageChannelBinder
public RabbitMessageChannelBinder(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory, org.springframework.boot.autoconfigure.amqp.RabbitProperties rabbitProperties, RabbitExchangeQueueProvisioner provisioningProvider)
-
RabbitMessageChannelBinder
public RabbitMessageChannelBinder(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory, org.springframework.boot.autoconfigure.amqp.RabbitProperties rabbitProperties, RabbitExchangeQueueProvisioner provisioningProvider, ListenerContainerCustomizer<org.springframework.amqp.rabbit.listener.MessageListenerContainer> containerCustomizer)
-
RabbitMessageChannelBinder
public RabbitMessageChannelBinder(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory, org.springframework.boot.autoconfigure.amqp.RabbitProperties rabbitProperties, RabbitExchangeQueueProvisioner provisioningProvider, ListenerContainerCustomizer<org.springframework.amqp.rabbit.listener.MessageListenerContainer> containerCustomizer, MessageSourceCustomizer<org.springframework.integration.amqp.inbound.AmqpMessageSource> sourceCustomizer)
-
-
Method Detail
-
setDecompressingPostProcessor
public void setDecompressingPostProcessor(org.springframework.amqp.core.MessagePostProcessor decompressingPostProcessor)
Set aMessagePostProcessorto decompress messages. Defaults to aDelegatingDecompressingPostProcessorwith its default delegates.- Parameters:
decompressingPostProcessor- the post processor.
-
setCompressingPostProcessor
public void setCompressingPostProcessor(org.springframework.amqp.core.MessagePostProcessor compressingPostProcessor)
Set aMessagePostProcessorto compress messages. Defaults to aGZipPostProcessor.- Parameters:
compressingPostProcessor- the post processor.
-
setAdminAddresses
public void setAdminAddresses(String[] adminAddresses)
-
setNodes
public void setNodes(String[] nodes)
-
setExtendedBindingProperties
public void setExtendedBindingProperties(RabbitExtendedBindingProperties extendedBindingProperties)
-
onInit
public void onInit() throws Exception
-
destroy
public void destroy() throws Exception- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-
getConnectionFactory
public org.springframework.amqp.rabbit.connection.ConnectionFactory getConnectionFactory()
Get the underlyingConnectionFactoryinstance to allow manually altering the connection lifecycle.
-
getExtendedConsumerProperties
public RabbitConsumerProperties getExtendedConsumerProperties(String channelName)
- Specified by:
getExtendedConsumerPropertiesin interfaceExtendedBindingProperties<RabbitConsumerProperties,RabbitProducerProperties>
-
getExtendedProducerProperties
public RabbitProducerProperties getExtendedProducerProperties(String channelName)
- Specified by:
getExtendedProducerPropertiesin interfaceExtendedBindingProperties<RabbitConsumerProperties,RabbitProducerProperties>
-
getDefaultsPrefix
public String getDefaultsPrefix()
- Specified by:
getDefaultsPrefixin interfaceExtendedBindingProperties<RabbitConsumerProperties,RabbitProducerProperties>
-
getExtendedPropertiesEntryClass
public Class<? extends BinderSpecificPropertiesProvider> getExtendedPropertiesEntryClass()
- Specified by:
getExtendedPropertiesEntryClassin interfaceExtendedBindingProperties<RabbitConsumerProperties,RabbitProducerProperties>
-
createProducerMessageHandler
protected org.springframework.messaging.MessageHandler createProducerMessageHandler(ProducerDestination producerDestination, ExtendedProducerProperties<RabbitProducerProperties> producerProperties, org.springframework.messaging.MessageChannel errorChannel)
-
postProcessOutputChannel
protected void postProcessOutputChannel(org.springframework.messaging.MessageChannel outputChannel, ExtendedProducerProperties<RabbitProducerProperties> producerProperties)
-
createConsumerEndpoint
protected org.springframework.integration.core.MessageProducer createConsumerEndpoint(ConsumerDestination consumerDestination, String group, ExtendedConsumerProperties<RabbitConsumerProperties> properties)
-
createPolledConsumerResources
protected AbstractMessageChannelBinder.PolledConsumerResources createPolledConsumerResources(String name, String group, ConsumerDestination destination, ExtendedConsumerProperties<RabbitConsumerProperties> consumerProperties)
-
postProcessPollableSource
protected void postProcessPollableSource(DefaultPollableMessageSource bindingTarget)
-
getErrorMessageStrategy
protected org.springframework.integration.support.ErrorMessageStrategy getErrorMessageStrategy()
-
getErrorMessageHandler
protected org.springframework.messaging.MessageHandler getErrorMessageHandler(ConsumerDestination destination, String group, ExtendedConsumerProperties<RabbitConsumerProperties> properties)
-
getPolledConsumerErrorMessageHandler
protected org.springframework.messaging.MessageHandler getPolledConsumerErrorMessageHandler(ConsumerDestination destination, String group, ExtendedConsumerProperties<RabbitConsumerProperties> properties)
-
errorsBaseName
protected String errorsBaseName(ConsumerDestination destination, String group, ExtendedConsumerProperties<RabbitConsumerProperties> consumerProperties)
-
afterUnbindConsumer
protected void afterUnbindConsumer(ConsumerDestination consumerDestination, String group, ExtendedConsumerProperties<RabbitConsumerProperties> consumerProperties)
-
afterUnbindProducer
protected void afterUnbindProducer(ProducerDestination destination, ExtendedProducerProperties<RabbitProducerProperties> producerProperties)
-
-