thingsboard / tbmq

Open-source, scalable, and fault-tolerant MQTT broker able to handle 4M+ concurrent client connections, supporting at least 3M messages per second throughput per single cluster node with low latency delivery. The cluster mode supports more than 100M concurrently connected clients.
https://thingsboard.io/products/mqtt-broker/
Apache License 2.0
570 stars 46 forks source link

[Bug] Retained messages and Remove Topics #91

Closed jot4p closed 5 months ago

jot4p commented 8 months ago

Hi,

It's not possible to remove retained messages:

image

I think that 1 devices is sending a lot of messages and I need to ignore them. It's possible to block only one topic ?

I removed the topic from the writing device and I still receive it.

image

dmytro-landiak commented 8 months ago

hi @jot4p!

Thanks for reaching out with the issue. You get the error shown above when you try to delete the retained message for a specific topic that already does not have the retained message. Please try to refresh the page with the Refresh button on the top right corner of the page before you try to delete it.

If you say the devices are sending a lot of messages, I assume some of those messages can clear the retained message with the empty payload, while others can create a retained message for a topic with a non-empty payload. And this could happen regularly. That could be the reason why you see the retained message on the UI but when you try to delete it you get that error.

I removed the topic from the writing device and I still receive it.

To understand why you still receive the messages while you removed the topic from the writing device, I need to see the exact patterns used for the client credential and the topic the device is using to publish the message.

It's possible to block only one topic ?

I can recommend you set a similar auth rule for publishing:

^(?!test/topic$).*$

Where test/topic should be replaced with the exact topic that you want to block. This pattern will allow to publish to any topic except for test/topic.

jot4p commented 8 months ago

Hi @dmytro-landiak,

Retained Messages:

It's not possible to remove the retained messages (I try everything)... ... maybe the button should force to remove...

Second topic:

If I remove the topic from the list of allowed topics... Why am I still receiving the data ?

dmytro-landiak commented 8 months ago

What version of TBMQ are you using? Single node deployment or cluster mode?

Retained Messages:

Do you get the same error you sent at the beginning? If yes, please let me know if the created time is changing for that topic.

Second topic:

Currently, the client should be reconnected to see that the allowed topics were changed. Is this the case for you? Was the client connected after the credentials were changed?

jot4p commented 8 months ago

First topic:

What version of TBMQ are you using? Single node deployment or cluster mode?

It's not possible to remove any message from the beginning.

image

Second topic:

Currently, the client should be reconnected to see that the allowed topics were changed. Is this the case for you? Was the client connected after the credentials were changed? before.. the client is connected from the beginning but if I restart the server the problem is the same.

dmytro-landiak commented 8 months ago

Unfortunately, it is hard to reproduce the explained issues. Is it possible to get access to your instance and UI? We can continue regarding this via email to avoid sharing sensitive info if you are fine with that (please send me something to dlandiak@thingsboard.io) Otherwise, I will continue investigating this but it will be hard to understand where the problem could be without more details about the patterns, topics, and logs.

dmytro-landiak commented 7 months ago

@jot4p hi! I have not heard from you for a while and did not get an email either. Are you able to provide me with more detailed info regarding the issue you are facing in private communication?