Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding MQTT v5 properties to output of mosquito_sub #1416

Closed
manifest opened this issue Sep 19, 2019 · 6 comments
Closed

Consider adding MQTT v5 properties to output of mosquito_sub #1416

manifest opened this issue Sep 19, 2019 · 6 comments

Comments

@manifest
Copy link

It seems reasonable to output MQTT v5 properties in the output of mosquito_sub. That may be hidden behind by -v, -d, and -F flags.

The current behavior

## Default
mosquitto_sub -V 5 -t 'foo'
bar

## Verbose
mosquitto_sub -v -V 5 -t 'foo'
foo bar

## JSON output of message parameters
mosquitto_sub -F "%j" -V 5 -t 'foo'
{
  "tst": 1568918942,
  "topic": "foo",
  "qos": 0,
  "retain": 0,
  "payloadlen": 3,
  "payload": "bar"
}

For

mosquitto_pub -V 5 -t 'foo' -m 'bar' -D publish user-property a b

Mosquitto version: 1.6.4
OS: macOS

@ralight
Copy link
Contributor

ralight commented Sep 24, 2019

Yes.

I'm not sure the best way to approach it though. Perhaps it could be restricted to the json output.

@manifest
Copy link
Author

manifest commented Oct 7, 2019

I'm not sure the best way to approach it though. Perhaps it could be restricted to the json output.

That will work for us.

@ralight
Copy link
Contributor

ralight commented Oct 15, 2019

This should now be working fully. Please give it a try on the develop branch. You can have it either in the JSON output using -F %j or -F %J, or using new format specifiers: -F %A %C %D %E %F %P %R %S.

tmp-props

@manifest
Copy link
Author

That seems fine to me. Thanks.

@manifest
Copy link
Author

manifest commented Oct 22, 2019

Just a note about binaries: it may be a bit more useful (readable) to represent them as arrays of integers (in a range of 0 - 255). We always know which property has the binary type, so there won't be any confusion.

@manifest
Copy link
Author

Payload is also a binary. It would be nice to attempt representing it as a string, at first. If not possible, to fall to the binary representation (array of integers).

@ralight ralight closed this as completed in 934ec73 Dec 2, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants