LWT (last will testament) down message timestamp

266 views
Skip to first unread message

Zafar Haq

unread,
Mar 20, 2017, 7:45:41 PM3/20/17
to rabbitmq-users
Is there a way to get LWT down message arrival time stamp?
Basically want to track time stamp of when device connection went down. I can always get the current time stamp but trying to figure out situation where consumption of message is delayed.
Appreciate your response.

I am using RabbitMQ version 3.6.5

Thanks.

Michael Klishin

unread,
Mar 20, 2017, 7:59:25 PM3/20/17
to rabbitm...@googlegroups.com
See http://github.com/rabbitmq/rabbitmq-event-exchange, it's much easier to use than using LWT
with e.g. dead-lettering or other hacks on top of hacks :)

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Zafar Haq

unread,
Mar 21, 2017, 9:31:14 AM3/21/17
to rabbitmq-users
Thank you for the response. Really appreciate it. I was able to implement the suggested plugin.
Now I ran into some other limitation. How can I associate a connection event to a device? Can I deconstruct the "id" field for that? is there a way to get "client id"? Also saw "client_properties" header in the message. Can I add client properties while creating a connection? Is there some other way to associate a down or up connection to a device?

LWT almost works for me except I don't have the time stamp of when the connection goes down.

Thanks.


On Monday, March 20, 2017 at 6:59:25 PM UTC-5, Michael Klishin wrote:
See http://github.com/rabbitmq/rabbitmq-event-exchange, it's much easier to use than using LWT
with e.g. dead-lettering or other hacks on top of hacks :)
On Tue, Mar 21, 2017 at 2:45 AM, Zafar Haq <conant...@gmail.com> wrote:
Is there a way to get LWT down message arrival time stamp?
Basically want to track time stamp of when device connection went down. I can always get the current time stamp but trying to figure out situation where consumption of message is delayed.
Appreciate your response.

I am using RabbitMQ version 3.6.5

Thanks.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Mar 21, 2017, 10:40:28 AM3/21/17
to rabbitm...@googlegroups.com
Client properties are client provided so you could inject a name (in fact, we already
have a feature for client-provided connection names) but they are a feature in AMQP 0-9-1, not MQTT.

Perhaps the MQTT plugin could take MQTT client ID and put it into the connection_name client property.
That'd tie the plugin to its current architecture, however, so I'm of two minds on this idea.

How do your devices authenticate? Do you use unique usernames or x509 certificates?

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Zafar Haq

unread,
Mar 21, 2017, 10:48:48 AM3/21/17
to rabbitmq-users
Currently we have single username shared across all devices.
Client id is the unique identifier for the devices.

Michael Klishin

unread,
Mar 21, 2017, 11:28:08 AM3/21/17
to rabbitm...@googlegroups.com
I see that we don't include username in `connection.close` events
in 3.6.x and even 3.7.0 (master).

Including that plus a user-provided connection name would be very useful in cases
such as yours. However, MQTT client ID would still need to be propagated into connection
details. We will discuss these two and file issues on GitHub on your behalf.

For now you'd have to list connections using HTTP API and keep track of new and gone connections
that way:

not ideal but we are aware of [proprietary] monitoring tools that have been doing just that for years
and it works decently.


To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Mar 21, 2017, 11:29:57 AM3/21/17
to rabbitm...@googlegroups.com
Also, while not related to this thread, sharing a username is a recipe for disaster.
Please consider x509 certificate authentication [1][2] or at least separate username + TLS
with peer verification.


To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Mar 21, 2017, 11:39:31 AM3/21/17
to rabbitm...@googlegroups.com
Right, so the reason why connection.closed doesn't contain a username
has to do with how socket exception handling is implemented for connections.
Without a pretty intrusive refactoring there is no way for us to get the username
as AMQP 0-9-1 (and MQTT) connection is a two or even three step process.

Perhaps you can combine HTTP API-based connection listing and tracking
based on username/certificate Common Name with rabbitmq-event-exchange events.

Zafar Haq

unread,
Mar 21, 2017, 9:57:02 PM3/21/17
to rabbitmq-users
Agree. Currently we are in prototype mode. I will check out your recommendations.

Thanks.
Reply all
Reply to author
Forward
0 new messages