Mqttnet: Issue being able to recieve retained messages

Created on 6 Jan 2019  路  10Comments  路  Source: chkr1011/MQTTnet

Hey,

Thanks for creating this library, works great and i've had zero issues. Was having some trouble though that i'm guessing is more due to my own ignorance. I am sending a message with the retain flag but when i restart my application and re-connect i am not receiving that retained message.
I've looked through the wiki and wasn't able to find anything on how to receive retained messages. So i've ensured that i've got a listener before connecting and tried to find other handlers without success, what am i missing?

To help i can see the retained messages working with other clients fine

support waiting-for-reply

Most helpful comment

I know i owe you an answer to this @SeppPenner thanks for being patient. I've had weddings and go lives since our last chat, when i get a second to breathe, i'll jump on this, promise!

All 10 comments

Hey @chkr1011, I know this is very much a "how do i" question but i've looked through all the docs and tried to find it in the code and I can't find anything. Any help would be appreciated greatly

Hi, I will try to check this and update the docs.

This should be what you're searching for: https://github.com/chkr1011/MQTTnet/wiki/Client#consuming-messages. Please feel free to re-open the issue if you have further questions.

That looks like the basic consumption of messages, I'll double check but i had no issue recieving messages when the client was live, it was recieving the messages that were sent when the client was offline but the messages were marked as retain

That looks like the basic consumption of messages

Well, it is like that.

Do you still see this issue in the latest version of MQTTnet?

I'll look into it this weekend, I'm using this as a new core to a smart house system i'm building but we've been doing other things around the house so this was put on hold. I'll check it out this weekend and let you know.

If it's still occurring, I'll try to set up an example and tests to show you

I know i owe you an answer to this @SeppPenner thanks for being patient. I've had weddings and go lives since our last chat, when i get a second to breathe, i'll jump on this, promise!

@dalefrancis88 Retained messages are only transmitted when subscribing to a topic which contains a retained messages. After that you cannot receive retained messages. They will be sent to the client automatically when updated as any other usual message.

Gotcha then it may be my usage of it. I'll find the code and double check

@dalefrancis88 I will close this now. If you see any issues, just add some more information here, please.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LADSoft picture LADSoft  路  4Comments

LouisCPro picture LouisCPro  路  7Comments

grobmiller picture grobmiller  路  5Comments

bilalmalik777 picture bilalmalik777  路  7Comments

ramonsmits picture ramonsmits  路  3Comments