[rabbitmq-discuss] RabbitMQ latency and message lost issue.

Shixin Song Shixin.Song at markit.com
Thu Mar 3 12:53:32 GMT 2011

Hi Marek,

Thanks a lot for your reply. I get the general idea about how to deal with it. Now I am looking at the first solution which to tell rabbit drop the message when it's too old. I saw the sample code from the link indicating how to do it in Java. But I am using C client library at this moment.  It seems that there is no queue declare interface at this moment. Could you indicate me that how to do it in C library. Here is the part of my code :

        conn = amqp_new_connection();

        die_on_error(sockfd = amqp_open_socket(hostName.c_str(), portNumber), "Opening socket");
        amqp_set_sockfd(conn, sockfd);
        die_on_amqp_error(amqp_login(conn, virtualHost.c_str()
                                                , 0
                                                , 131072,
                                        "Logging in");
        amqp_channel_open(conn, 1);
        die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");



Thanks a lot.

Best regards

From: Marek Majkowski [majek04 at gmail.com]
Sent: Thursday, March 03, 2011 1:34 PM
To: Shixin Song
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] RabbitMQ latency and message lost issue.

On Wed, Mar 2, 2011 at 13:43, Shixin Song <Shixin.Song at markit.com> wrote:
> To whom it may concern,
> I am testing RabbitMQ at this moment. I have installed rabbitmq server and developed C++ client library using rabbitmq C library.
> I found out that RabbitMQ never drops the message which means it has 0 message loss. But in my case, the latency is much more important than the message loss. Some message loss is acceptable in order to limit the maximal message latency. Could any one inform me how to configure rabbitmq to let it drop some messages when the latency is too high or the queue is reached to a maximum value.

You can tell rabbit to drop messages 'older than' something -

Also take a look at immediate flag to basic.publish (this will forbid
message from
being published if it can't be delivered to a consumer immediately)

But it's your responsibility to ensure that messages are being consumed
fast enough. Queue.ttl and 'immediate' may help, but eventually
RabbitMQ is a queuing system constructed to queue messages - not lose
them randomly.


This e-mail, including accompanying communications and attachments, is strictly confidential and only for the intended recipient. Any retention, use or disclosure not expressly authorised by Markit is prohibited. This email is subject to all waivers and other terms at the following link: http://www.markit.com/en/about/legal/email-disclaimer.page

We have recently moved to our new head office located at Ropemaker Place, 25 Ropemaker Street, London, EC2Y 9LY.
Please visit http://www.markit.com/en/about/contact/contact-us.page? for contact information on our offices worldwide.

More information about the rabbitmq-discuss mailing list