[rabbitmq-discuss] rabbitmq-c TTL setting not working for me - please help

ktran0003 at gmail.com ktran0003 at gmail.com
Tue Jun 17 02:01:42 BST 2014


I set up a queue via amq.direct exchange with one producer and one consumer.
I used the following code to set up TTL for the consumer:

    amqp_table_t table;
    amqp_table_entry_t entry;
    entry.key = amqp_cstring_bytes("x-message-ttl");
    entry.value.kind = AMQP_FIELD_KIND_I16;
    entry.value.value.i16 = 2000;
    table.num_entries = 1;
    table.entries = &entry;
    amqp_queue_declare_ok_t *r = amqp_queue_declare(conn, 1, 
amqp_empty_bytes, 0, 0, 0,  table);

Then every time I consume a message, I sleep for 5 secs just to delay the 
consuming rate.
I also have the producer send a message every 1 sec.

However, when I run the producer to produce 20 messages, the consumer will 
get all 20 messages with 5 sec delay in between.
Should some messages not delivered because of TTL  < 5 sec delay?

Thanks,
-Kim


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140616/a7b787c8/attachment.html>


More information about the rabbitmq-discuss mailing list