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-SN subscriber doesn't receive any messages after a reconnection (clean session disabled and QOS=1 for messages) #733

Open
marcoratto opened this issue Jan 8, 2025 · 1 comment
Labels
tracked Tracked by an external ticketing system

Comments

@marcoratto
Copy link

Expected behavior

If a subscriber disconnected from a MQTT-SN Broker, it should receive all messages sent during the disconnection period once it reconnects.
According to the specification MQTT-SN_spec_v1.2.pdf, page 22:

6.3 Clean session
With MQTT, when a client disconnects, its subscriptions are not deleted. They are persistent and valid for new
connections, until either they are explicitly un-subscribed by the client, or the client establishes a new connection
with the “clean session” flag set.
In MQTT-SN the meaning of a “clean session” is extended to the Will feature, i.e. not only the subscriptions
are persistent, but also the Will topic and the Will message.

Actual behavior

MQTT-SN subscriber doesn't receive any messages.

To Reproduce

Step 0: Run HiveMQ Edge on a Docker Container

docker pull hivemq/hivemq-edge
docker run --name hivemq-edge -d -p 1883:1883 -p 8080:8080 -p 2442:2442/udp hivemq/hivemq-edge

Step 1: Subscribe to an MQTT topic

mosquitto_sub -h 127.0.0.1 -p 1883 -c -i mqtt-client-sub -t mqttsn/sample/normal -q 1

clean session disabled, QOS=1 and ClientID fixed

Step 2: Subscribe to an MQTT-SN normal topic

mqtt-sn-sub -h 127.0.0.1 -p 2442 -c -q 1 -i mqttsn-client-sub -t mqttsn/sample/normal

clean session disabled, QOS=1 and ClientID fixed

Step 3: send a message on MQTT topic

mosquitto_pub -h 127.0.0.1 -p 1883 -t mqttsn/sample/normal -m "hello 1" -q 1

Step 4: send a message on MQTT topic

mosquitto_pub -h 127.0.0.1 -p 1883 -t mqttsn/sample/normal -m "hello 2" -q 1

Step 5: Stop MQTT subscriber

Stop mosquitto_sub

Step 6: Stop MQTT-SN Subscriber

Stop mqtt-sn-sub

Step 7: send a message on MQTT topic

mosquitto_pub -h 127.0.0.1 -p 1883 -t mqttsn/sample/normal -m "hello 3" -q 1

Step 8: send a message on MQTT topic

mosquitto_pub -h 127.0.0.1 -p 1883 -t mqttsn/sample/normal -m "hello 4" -q 1

Step 9: Subscribe again to an MQTT topic

mosquitto_sub -h 127.0.0.1 -p 1883 -c -i mqtt-client-sub -t mqttsn/sample/normal -q 1

Receive correctly messages "hello 3" and "hello 4"

Step 10: Subscribe again to an MQTT-SN normal topic (ERROR)

mqtt-sn-sub -h 127.0.0.1 -p 2442 -c -q 1 -i mqttsn-client-sub -t mqttsn/sample/normal

It doesn't receive any messages.
No error log on container image.

Reproducer code

n/a

Details

  • Affected HiveMQ Edge version(s): 2024.9
  • Used JVM version: Internal of the container
@sfrehse sfrehse added the tracked Tracked by an external ticketing system label Jan 14, 2025
@sfrehse
Copy link
Contributor

sfrehse commented Jan 14, 2025

Thanks for reporting and the detailed description. We will track this more detailed internally to work on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracked Tracked by an external ticketing system
Projects
None yet
Development

No branches or pull requests

2 participants