Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Introspecting information about last wills in Mosquitto

Alex R <ralienpp@xxxxxxxxx> writes:

> I am writing some automated acceptance tests for robots that use MQTT for
> communication. One of the steps is to ensure that the robot's MQTT client
> has set a last will.
>
> Assuming that I have root access to the machine where Mosquitto is running,
> is there a way to check this programmatically?

You could extend mosquitto to have an API for this, perhaps some kind of
$SYS topic where meta info about each client is.

> I'd like to avoid the need of having a human to physically walk to the
> robot and unplug its antenna or perform some other action to actually
> provoke a real "client disconnected ungracefully" situation. The $SYS
> topics didn't provide anything that seemed useful for this goal, so I'd
> like to tap into the collective mind to find some potential approaches I
> could try. If there's no direct solution, perhaps there would be a "next
> best alternative"?

I would look into a machine in between the robot and the broker that is
controllable, in terms of adding firewall rules, or just taking one of
the interfaces down.   If you want to test what happens when the network
fails, best to fail the network.

You could also add a hook to the robot to have it halt.

Attachment: signature.asc
Description: PGP signature


Back to the top