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 - expose clean session option #220

Open
uwejan opened this issue Oct 8, 2019 · 9 comments
Open

MQTT - expose clean session option #220

uwejan opened this issue Oct 8, 2019 · 9 comments

Comments

@uwejan
Copy link

uwejan commented Oct 8, 2019

Using linux appimage , there is not an option for clean session, instead its always true, the appimage is great but controlling the session flag is very important, any idea?

@thomasnordquist
Copy link
Owner

Please elaborate in greater detail what are you are trying to achieve.

@uwejan
Copy link
Author

uwejan commented Oct 8, 2019

@thomasnordquist the appimage dsoe not have an option for clean session of login/subscribe , after tracing my connection to the server, i found out the appimage sets it automatically to true, what am saying having an option to control the session flag would be great add to the appimage.

@uwejan
Copy link
Author

uwejan commented Oct 8, 2019

@thomasnordquist am using version 0.3.5, i noticed there is 0.3.6 on the pre-release dose the new 1 have the option for session?

@thomasnordquist
Copy link
Owner

Okay I get your point. (The session flag is not affiliated in any way with AppImage)

The current behavior is that MQTT-Explorer resubscribes to all topics after a reconnect, but the server does not store a queue of not-yet transmitted messages.

Can you describe the problem you want to solve?

@uwejan
Copy link
Author

uwejan commented Oct 8, 2019

i think it dsoe set the cs:1, however here is the trace log;

New session with PID <8963.907.0> found for client "mqtt-explorer-7564280a"
<8963.907.0> MQTT RECV: CID: "mqtt-explorer-7564280a" CONNECT(c: mqtt-explorer-7564280a, v: 4, u: username, p: password, cs: 1, ka: 60)

sure, the mentioned above client1 is offline now, right? then client3 send a message to client1 on topic/dummy with retain flag, now client1, login the server, subs to topic/# but dose not see the message.
expected behaviour, is that once client 1 should recieve the message sent by client3, the only thing i can think of is clean session flag, and i have provided the logs as prove, going to try another client to amek sure now.

@uwejan
Copy link
Author

uwejan commented Oct 8, 2019

with another client it works as expected, now with appimge its only with websockets set to true, with tcpp its set to false.

@thomasnordquist thomasnordquist changed the title Linux appimage MQTT - expose clean session option Oct 24, 2019
@svet-b
Copy link

svet-b commented Feb 17, 2021

Just wanted to add my voice to this, and maybe mention the use case. We have a number of IoT devices publishing data to a broker, all with QoS=1. Currently when I connect to the broker with MQTT Explorer, I am only able to see newly published messages - i.e. anything that comes in after I connected.

In addition, upon connection I would also like to receive messages that were published "while I was out". According to my understanding of the MQTT spec, this should be achievable if my client sets the "clean session" flag to 0 upon each connection. Therefore it would be great to be able to set that, rather than always connect with clean session=1.

My main workaround currently is to keep MQTT Explorer connected and subscribed continuously, so that at any given point I can see the last data. Though it would be nice to not have to do that.

Either way, thanks for a great tool!

@marioishikawa
Copy link

Is this planned? This would be required for a case like this one: https://www.hivemq.com/blog/mqtt-essentials-part-7-persistent-session-queuing-messages/

@123dev
Copy link

123dev commented Mar 13, 2023

There needs to be the possibility to specify.

  • The client id
  • clean session

When the clean session is set to false, the broker keeps all the unread messages for the set client, and if MQTT explorer re-connects with randomized clients id, it will still not see the missed messages, furthermore, these messages would remain on the broker perpetually causing broker issues over time (running out of memory)

The two options go hand in hand, if you want to use the clean session = false, you should be reconnecting with the same client id.

It would be great if these two flags are added this is great app.

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

5 participants