[rabbitmq-discuss] creating connections to RMQ

Rob Woolfson rob at bsdsoftware.co.il
Wed Feb 13 16:26:33 GMT 2013


We are looking at the best way to use only one connection and have only the
channel created each time.  Bear in mind that its all happening on the same
physical server and the servers that I refer to are actually software
services as opposed to different physical machines.  So network latency
shouldnt be a big problem here.

It is possible I need to rethink my strategy a little.

The application is for trading.

S1 receives a signal to open a trade and sends the order to S2 which is
responsible for sending the trade to the brokers.  When S1 receives a
signal to open the trade it creates an object to manage all the
communication back and forth between the broker.  So it creates a queue
that will route all incoming messages to do with that specific trade back
to the object.  For this reason the object (which is a new object for each
trade) will create a new channel, queue and binding, specifically for the
life of the trade.

Thanks for the suggestions, I may need to think about this process and
decide which is the best way to use RMQ.




On Wed, Feb 13, 2013 at 5:51 PM, Simon MacMullen <simon at rabbitmq.com> wrote:

> On 13/02/13 13:18, Rob Woolfson wrote:
>
>> What is the suggested best practice for speeding up my process?
>>
>
> There are several things you can do:
>
> Creating a new connection / channel takes several network round trips -
> can you get P1 to keep a connection / channel open?
>
> Creating a new queue is quite expensive (especially if it's durable) - can
> C1 reuse its reply queue?
>
> Declaring / binding the queue and exchange, and consuming from the queue
> also takes some network round trips by default, since each AMQP method will
> cause a corresponding -ok method to be sent back. To eliminate the round
> trips you can use the nowait parameter to declare / bind / consume - this
> prevents an -ok method from coming back, so all the requests can be
> pipelined. Alternatively if your reply queue is reused you can skip
> redeclaring it each time, just declare it and consume from it once.
>
> Cheers, Simon
>
> --
> Simon MacMullen
> RabbitMQ, VMware
>



-- 
Rob Woolfson - CTO
mobile:+972-544904157
office:+972-3-5353751
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130213/8867244b/attachment.htm>


More information about the rabbitmq-discuss mailing list