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

MQTT binding why publish and subscribe of the same topic #588

Open
jvermillard opened this issue Nov 7, 2024 · 0 comments
Open

MQTT binding why publish and subscribe of the same topic #588

jvermillard opened this issue Nov 7, 2024 · 0 comments

Comments

@jvermillard
Copy link

According to https://www.openmobilealliance.org/release/LightweightM2M/V1_2_1-20221209-A/HTML-Version/OMA-TS-LightweightM2M_Transport-V1_2_1-20221209-A.html#8-0-8-MQTT-Transport-Binding

A LwM2M Server subscribes to "{PREFIX}/lwm2m/rd/#" to receive messages from LwM2M Clients. A LwM2M Server publishes responses to a specific endpoint, {ENDPOINT}, via "{PREFIX}/lwm2m/rd/{ENDPOINT}".

If you structure your topic like this, the server will receive an echo the response message it publishes to the client

Server subscribe to /lwm2m/rd/#
Device A publishes a registration on /lwm2m/rd/A, the server receives the request, and publishes the response on /lwm2m/rd/A

Since the server is subscribed to the wildcard/lwm2m/rd/# it will receive an echo of it's published message.

Is it expected? This is inefficient, because the server will need to discard this message and also the broker will deliver 2 messages in place of 1

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

No branches or pull requests

2 participants