[rabbitmq-discuss] How to use separate connections for sending and receiving data in Spring-RabbitMQ?
tim at rabbitmq.com
Tue May 7 07:46:30 BST 2013
According to the spring-amqp docs, the CachingConnectionFactory will create a proxy to a single connection only, so you'll either need to have two connection factory beans in your configuration or inherit AbstractConnectionFactory and create your own using Rabbit's own client APIs. You might also want to consider using a MessageListenerContainer bean to consume asynchronously, but even if you stick with AmqpTemplate, you'll need to configure another bean for consuming so that it will use another (different) connection factory bean and thereby ensure a second connection is used.
I'd suggest asking on a spring-amqp forum or mailing list if you need more detailed assistance.
On 7 May 2013, at 00:58, Kapil Goyal wrote:
> While exploring flow-control in RabbitMQ, I found this:
> “The intent here is to introduce a flow control mechanism that throttles producers but lets consumers continue unaffected. However, since AMQP permits producers and consumers to operate on the same channel, and on different channels of a single connection, this logic is necessarily imperfect. In practice that does not pose any problems for most applications since the throttling is observable merely as a delay. Nevertheless, other design considerations permitting, it is advisable to only use individual AMQP connections for either producing or consuming.”
> I am using Spring Integration in my web-application to send/receive data to/from RabbitMQ broker. I declare connection-factory, amqp-template, rabbit-admin, channels and inbound/outbound adapters using XML. What is the recommended way to ensure separate connections are used for sending and receiving? My observation is that by default, both sending and receiving are done on the same connection but on different channels.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss