Comments (5)
MQTT 5.0 in version 0.17
Just a note, Moquette v0.17 doesn't implement MQTT5
from moquette.
I'll check this, but from MQTT specification http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html :
If the Server receives a QoS 0 message with the RETAIN flag set to 1 it MUST discard any message previously retained for that topic. It SHOULD store the new QoS 0 message as the new retained message for that topic, but MAY choose to discard it at any time - if this happens there will be no retained message for that topic [MQTT-3.3.1-7].
So the server MUSTN'T store the retain in session state if the QoS is 0.
However I'll check this. Thanks for reporting!
from moquette.
Your welcome dear @andsel
Did you implement MQTT 5.0 in the code?
You wrote in #808 :
Retain As Published
The Retain As Published option has two possible values, 0 and 1.
1 means the server should preserve the Retain flag unchanged when forwarding application messages to subscribers
0 means that the Retain flag must be cleared.
Also this setting is used in bridging situations.
It seems you have used this logic in the moquette version 0.17.
from moquette.
Did you implement MQTT 5.0 in the code?
I'm implementing it, but forv0.18-SNAPSHOT
It seems you have used this logic in the moquette version 0.17.
How it's possible if the Retain As Published
option only exists in MQTT5 subscribe and that code is part of 0.18?
Retain As Published
relates to the fact that the retain
flag of a publish message should be forwarded as it's received from the publisher (used in proxy use cases) or must be cleared. But this is unspecified in MQTT3 (if I'm not wrong).
While the problem you are reporting relates to the fact that a publish with QoS0 and retained = true it's not effectively retained, as I can understand from your description.
from moquette.
How it's possible if the
Retain As Published
option only exists in MQTT5 subscribe and that code is part of 0.18?
Retain As Published
relates to the fact that theretain
flag of a publish message should be forwarded as it's received from the publisher (used in proxy use cases) or must be cleared. But this is unspecified in MQTT3 (if I'm not wrong).
I know what you mean, but I thought maybe you did it (MQTT 5.0 in version 0.17) wrong.
So, you must check your implementation to check why retain=true
does not work with QoS=0
in version 0.17
.
You can check it simply using the below:
#First publish a sample topic:
mosquitto_pub -h host.com -p moqttPort -u username1 -P password1 -i clientID1 -t topic1 -m message1 -r -q 0
#Then subscribe to get last published (retained) message of the above topic:
mosquitto_sub -h host.com -p mqttPort -u username2 -P password2 -i clientID2 -t topic1
While the problem you are reporting relates to the fact that a publish with QoS0 and retained = true it's not effectively retained, as I can understand from your description.
Exactly! That's what I mean
from moquette.
Related Issues (20)
- Server can define its own Keep Alive in CONNACK
- [Meta] Implement Shared Subscriptions HOT 1
- Support topic that starts with `$` character
- The official example code is misleading and may cause Java OutOfMemoryError. HOT 1
- Implement Subscription identifier
- Implements Subscription Options HOT 1
- java.lang.NoSuchMethodError: No static method encodeHexString([B)Ljava/lang/String; in class Lorg/apache/commons/codec/binary/Hex; or its super classes (declaration of 'org.apache.commons.codec.binary.Hex' appears in /system/framework/org.apache.http.legacy.boot.jar) HOT 2
- Confuse on SessionEventLoopGroup.routeCommand method HOT 4
- Implement message expiry intervals functionality HOT 1
- publish2Subscribers(payload, topic, qos); catch Exception java.lang.NullPointerException: null HOT 3
- io.moquette.broker.SessionCorruptedException: Session has already changed state: Session{clientId='xxx', clean=true, status=CONNECTING, inflightSlots=10} HOT 3
- Payload format and content type HOT 1
- Request / Response: Formalize the request/response pattern within MQTT
- High CPU usage when MQTT client disconnect and reconnect
- Shrared buffer issues due to readerIndex
- The shared subscription was not successful. HOT 1
- High CPU usage when run Ctrie.insert function HOT 43
- Periodic failure HOT 1
- Flow control
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moquette.