Hi,

How can we measure how long a message has been in a queue before it is
delivered to a consumer? If the message was in a queue for more than a
certain amount of time we would like to ignore it for example. Our
message publisher and consumers are on different machines and we
cannot synchronize their clocks, so the publish time cannot be set by
the publisher and checked by the consumer. Is there any way to get
this information from RabbitMQ?

Thanks,

Search Discussions

  • Jerry Kuch at Feb 7, 2012 at 4:28 pm
    Hi, Rasadoll...

    Do you really want to measure the time spent in a queue by the
    message and do something with that information or do you just want
    messages to vanish after they get appropriately stale? If the
    latter, check out:

    http://www.rabbitmq.com/extensions.html

    And check out the "Per-Queue Message TTL" session. It describes
    a RabbitMQ extension to AMQP that lets you declare a queue with
    a new argument, x-message-ttl, that controls how long a message
    published to that queue can live before the broker discards it.
    Messages that have exceeded the TTL set for their queue are
    considered dead, won't be delivered to consumers, and will
    be expunged periodically.

    Note that you specify the TTL in *milliseconds*... :-)

    Best regards,
    Jerry

    ----- Original Message -----
    From: "rasadoll" <rasadoll at gmail.com>
    To: rabbitmq-discuss at lists.rabbitmq.com
    Sent: Tuesday, February 7, 2012 8:11:33 AM
    Subject: [rabbitmq-discuss] Message wait time in a queue

    Hi,

    How can we measure how long a message has been in a queue before it is
    delivered to a consumer? If the message was in a queue for more than a
    certain amount of time we would like to ignore it for example. Our
    message publisher and consumers are on different machines and we
    cannot synchronize their clocks, so the publish time cannot be set by
    the publisher and checked by the consumer. Is there any way to get
    this information from RabbitMQ?

    Thanks,
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
  • Rasadoll at Feb 7, 2012 at 5:05 pm
    Thanks Jerry,
    Your direction would help us to partially address our problem, but we
    are still interested about the wait time to further optimize our
    system. We know the time to process and ack a message but we don't
    know how long it took to start its processing.

    Thanks,
    On Feb 7, 11:28?am, Jerry Kuch wrote:
    Hi, Rasadoll...

    Do you really want to measure the time spent in a queue by the
    message and do something with that information or do you just want
    messages to vanish after they get appropriately stale? ?If the
    latter, check out:

    http://www.rabbitmq.com/extensions.html

    And check out the "Per-Queue Message TTL" session. ?It describes
    a RabbitMQ extension to AMQP that lets you declare a queue with
    a new argument, x-message-ttl, that controls how long a message
    published to that queue can live before the broker discards it.
    Messages that have exceeded the TTL set for their queue are
    considered dead, won't be delivered to consumers, and will
    be expunged periodically.

    Note that you specify the TTL in *milliseconds*... :-)

    Best regards,
    Jerry







    ----- Original Message -----
    From: "rasadoll" <rasad... at gmail.com>
    To: rabbitmq-disc... at lists.rabbitmq.com
    Sent: Tuesday, February 7, 2012 8:11:33 AM
    Subject: [rabbitmq-discuss] Message wait time in a queue

    Hi,

    How can we measure how long a message has been in a queue before it is
    delivered to a consumer? If the message was in a queue for more than a
    certain amount of time we would like to ignore it for example. Our
    message publisher and consumers are on different machines and we
    cannot synchronize their clocks, so the publish time cannot be set by
    the publisher and checked by the consumer. Is there any way to get
    this information from RabbitMQ?

    Thanks,
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
  • Ask Solem at Feb 7, 2012 at 5:16 pm

    On 7 Feb 2012, at 17:05, rasadoll wrote:

    Thanks Jerry,
    Your direction would help us to partially address our problem, but we
    are still interested about the wait time to further optimize our
    system. We know the time to process and ack a message but we don't
    know how long it took to start its processing.
    You could add a timestamp to the message headers when you publish the message,
    the subtract that when you consume it.
    Of course then the time will include the time it took to send the message, but
    that is probably not an issue?
  • Rasadoll at Feb 7, 2012 at 5:22 pm
    If the publisher and consumer are on different machines, this approach
    will not work correctly as their clocks are not synchronized.

    On Feb 7, 12:16?pm, Ask Solem wrote:
    On 7 Feb 2012, at 17:05, rasadoll wrote:

    Thanks Jerry,
    Your direction would help us to partially address our problem, but we
    are still interested about the wait time to further optimize our
    system. We know the time to process and ack a message but we don't
    know how long it took to start its processing.
    You could add a timestamp to the message headers when you publish the message,
    the subtract that when you consume it.
    Of course then the time will include the time it took to send the message, but
    that is probably not an issue?

    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
  • Ask Solem at Feb 7, 2012 at 6:48 pm

    On Feb 7, 2012, at 5:22 PM, rasadoll wrote:

    If the publisher and consumer are on different machines, this approach
    will not work correctly as their clocks are not synchronized.
    Well, with network synchronized clocks it should be good enough for most use cases, but you didn't tell us yours.

    On Feb 7, 12:16 pm, Ask Solem wrote:
    On 7 Feb 2012, at 17:05, rasadoll wrote:

    Thanks Jerry,
    Your direction would help us to partially address our problem, but we
    are still interested about the wait time to further optimize our
    system. We know the time to process and ack a message but we don't
    know how long it took to start its processing.
    You could add a timestamp to the message headers when you publish the message,
    the subtract that when you consume it.
    Of course then the time will include the time it took to send the message, but
    that is probably not an issue?

    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedFeb 7, '12 at 4:11p
activeFeb 7, '12 at 6:48p
posts6
users3
websiterabbitmq.com
irc#rabbitmq

3 users in discussion

Rasadoll: 3 posts Ask Solem: 2 posts Jerry Kuch: 1 post

People

Translate

site design / logo © 2023 Grokbase