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

Receiving Category information with Flat topic mode #45

Closed
benaish opened this issue Mar 15, 2023 · 3 comments
Closed

Receiving Category information with Flat topic mode #45

benaish opened this issue Mar 15, 2023 · 3 comments

Comments

@benaish
Copy link

benaish commented Mar 15, 2023

I'm using the Flat topic mode due to level limitation in AWS IoT Core.
By doing that I'm losing important information that i would like to get as part of each message - Category (Event/Sample/..). It would be great to keep getting this information also on the flat topic mode. Another option could be to get this as part of the payload - but currently the Json formatter skips the Category when creating the payload out of the observation:
return CreateMessage(topic, Formatters.EntityFormatter.Format(documentFormatterId, observation));

Related to a discussion in issue #42

@PatrickRitchie
Copy link
Contributor

@benaish I agree that each message should contain Category. I'm looking at how to handle the MQTT Json to contain Category but the regular Json (sent over Http) to not contain Category since it is part of a full Response Document as opposed to MQTT that only sends the Entity.

My approach will most likely be to use an Options list (KeyValuePair) to pass a flag to the JsonEntityFormatter.Format(IEnumerable observations). I have a similar Options list for other methods in the EntityFormatter class.

I should have this added in a new release over the weekend.

Let me know if you have any further thoughts on how to handle this or if you have any other questions.

Thanks,
-Patrick

PatrickRitchie added a commit that referenced this issue Mar 20, 2023
…ryOutput' option for JSON used for MQTT to address issue #45
@PatrickRitchie
Copy link
Contributor

I just published the new 5.4.0 Release that contains this fix as well as some other additions to the MQTT implementation. More information can be found Here.

Let me know if this is what you were looking for.

Thanks,
-Patrick

@benaish
Copy link
Author

benaish commented Mar 21, 2023

have a similar Options list for other methods in the EntityFormatter class.
UPDATE: Works as expected

That's great, I will look into it!

Thanks,
Moshe

@benaish benaish closed this as completed Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants