VerneMQ how to disconnect clients forceably per command line

There is a command

vmq-admin session show

which will show you the currently connected clients:

image

Unfortunately, this output is truncated for a total width of 80 characters (no matter how many would fit) and there is currently no indication that it is.

See this VerneMQ Github issue: https://github.com/vernemq/vernemq/issues/1200

To disconnect clients you need the client_id and the mountpoint. Therefore, you can do:

vmq-admin session show –client_id –mountpoint

image

This will show you non-truncated versions (ideally, if you are not going overboard with the length of the mountpoint, the whole line still has to fit in 80 characters!)

And then you can disconnect the client you want by:

vmq-admin session disconnect client-id=js.1565274250169CEV7hJU –mountpoint=5c61a59ba6b76f558d256f42

Another “gotcha” is that VerneMQ’s vmq-admin will show you “Done” irrespectively of whether actual clients were disconnected or not!

image

As you can see, I left off one character of the client id, there is no client with that id – but the result is identical.

Therefore you have to recheck with the vmq-admin session show command, whether your disconnect was actually successful.