Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Message used for publishing might not be the same one received when subscribing #13

Open
fmvilas opened this issue Sep 14, 2017 · 6 comments

Comments

@fmvilas
Copy link
Contributor

fmvilas commented Sep 14, 2017

Even though I discourage to use different messages for the publish operation and the subscribe operation, it's something people are doing so we have to support it. Example:

https://ubidots.com/docs/api/mqtt.html#subscribe-to-a-variable

screen shot 2017-09-14 at 21 45 48

In this image, we can see how id is part of the message but it's only there when subscribing.

@MikeRalphson
Copy link
Contributor

Similar to OpenAPI's readOnly / writeOnly properties?

@fmvilas
Copy link
Contributor Author

fmvilas commented Sep 14, 2017

Yes, that could solve this particular case, but speaking to some IoT providers they told me that when you subscribe to a topic you might receive a totally different message than the one you published in the same topic.

So I would say it should support both, readOnly/writeOnly and a totally different message for each operation.

Thanks Mike!

@philsturgeon
Copy link

Curious about how this is happening. Are there processes intercepting the events and manipulating them somehow?

@fmvilas
Copy link
Contributor Author

fmvilas commented Jan 11, 2018

@philsturgeon yes, that's what I've seen in some IoT applications. Not definitely a good practice in my opinion. But that's my personal opinion :)

@NicoHood
Copy link

I'd call that a bad design. This is something you should never do in mqtt. Publish and subscribe at the same topic, even with the same data.

And in the example above the id field can be marked optional. There you have your two options. And additionally you can specify both a subscriber and a publisher to the same topic, so where is the problem?

I possibly misunderstood something or the issue might be outdated.

@fmvilas
Copy link
Contributor Author

fmvilas commented Jul 20, 2018

I understand your point @NicoHood, but AsyncAPI is not only for MQTT and not only for broker architectures. The spec should not enforce any architecture decision.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants