[rabbitmq-discuss] How to use separate connections for sending and receiving data in Spring-RabbitMQ?

Tim Watson tim at rabbitmq.com
Tue May 7 07:46:30 BST 2013


Hi,

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.

Cheers,
Tim

On 7 May 2013, at 00:58, Kapil Goyal wrote:

> Hi,
>  
> 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.
>  
> Thanks
> Kapil
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130507/779f1f8f/attachment.htm>


More information about the rabbitmq-discuss mailing list