When I subscribe to a topic using node-red with QoS set to 1 the received messages indicate that they are sent as QoS 0. This is replicated when troubleshooting using MQTT.fx .
Am I mistaken that subscribing with QoS 1 is supported, or is there something else that I am missing?
Is there any intent to implement QoS 1 for subscriptions? It seems quite central to ensuring reliable communication with a range of distributed devices with disparate connectivity.
The embedded MQTT service was one of the attractions of the Losant platform; it would be disappointing to have to integrate with an external MQTT server.
I submitted a ticket to investigate supporting QoS 1 for client subscriptions. In the meantime, if you require the functionality, we do have an MQTT integration that will allow you to use a third party MQTT broker while using Losant for additional functionality.
@Brandon_Cannaday : almost 4 years later, but weāre in the same boat as the post in here āŗ our MQTTS broker prefers/suggests SSL/Certificate (which we already implemented successfully) andQoS 1 - currently all messages in Losant are showing in the broker as QoS 0. I apologize if this has already been addressed elsewhere, if not, is QoS 1 still āon the worksā ? Thanks,
QoS 1 is supported for publishing to Losantās broker. This results in every message being PUBACKād by the broker to verify delivery.
QoS 1 is technically allowed for subscriptions, but Losantās broker does not support cleansession=0, which means unacknowledged publishes to client subscription will not be retried.
You can find a few more details and the reason these are not currently supported in the following thread:
I am assuming by cleansession=0 you mean the [ā] Clean option in the Losant Integration page to be āuncheckedā, which is not. Please correct me if wrong. If thatās the case, is showing on the broker (I consider Losant to be the client) as QoS=0:
I see, youāre referring to Losantās MQTT integration connecting to other brokers. This thread, and the other thread I linked are referring to clients connecting to Losantās broker.
Supporting QoS 1 for integration subscriptions may be possible. Iāll create a ticket to investigate.
Yep, Losant provides an MQTT broker. Itās one of the most common ways for devices to send telemetry data to the platform. All the details can be found here:
Oh, yes, I remember now - Losant broker canāt change the topic and has to be fixed (no wildcards). Nevermind. I remember now why it didnāt work for us and we had to go to an independent broker. Yes, if you can find about QoS1 thatād be great!
You can use any arbitrary topics with Losantās broker and wildcards are supported in most places. Can you describe the limitation you experienced in more details?
That makes sense. Connections to the broker require a device to authenticate, which makes it hard to use for system-to-system or āapplication levelā access. Weāve been exploring ways to authenticate against the broker at an application level, specifically to help enable system-to-system integrations.
Ok, so it does not accept āarbitrary topics*ā and/or 'wildcardsā. Because of this weāve been at it for 2 years and are {now} comfortable with independent brokers. Our current MQTTS connection is SSL and Certified (thanks for that solution!). We just need the QoS1 clarification and weāll be !
It does accept arbitrary topics and wildcards. Your issue is more of an authentication problem, where a connection requires a device ID. Itās not uncommon for customers to use a ādummyā device as a way to get a client ID that can connect to the broker. The device isnāt used for any other purpose.
For example, you could have all of your devices publish data to my/custom/topic/<device-id> and then other devices (or the dummy device) can subscribe to the wildcard my/custom/topic/# and receive data for every topic under that wildcard. You can also use the MQTT Trigger to fire a workflow on that same wildcard topic.
As a note, additional topics are restricted by default. Youāll have to grant your access key access to the my/custom/topic/# wildcard topic. Details here:
Ok, this is definitely something in need of exploring further from our side. Wish it wouldāve been a bit āsimplerā and āclearerā and not such the confusion since 2 years ago. We will explore these newer suggested options along with our current external efforts and evaluate/decide on what works best for us,
@Brandon_Cannaday , weāre looking at this a bit furtherā¦ when you say āother devices (or the dummy device) can subscribe to the wildcardā, can you explain a bit further so I can understand it? How will the devices subscribe to it, via the integration? Thanks,
The MQTT Integration is not used in this scenario. The Integration allows Losant to subscribe to third-party MQTT brokers.
In this scenario, devices are connecting, publishing, and subscribing directly to Losantās MQTT broker.
mqtts://broker.losant.com
The deviceās access key/secret, which is used as the username and password in the MQTT connection, controls which topics a device is allowed to publish and subscribe to.
By default, an access key only allows a device to publish and subscribe to the special device-specific topics (e.g. state and command). However, you can grant access to any arbitrary topics you choose, including wildcard topics.
In your case, I would expect something like the following:
Devices publishing data would be restricted to a topic containing their ID - e.g. myCustomTopic/{deviceId}.
For wildcard access, youād create an access key that was granted access to the wildcard version of that topic - e.g. myCustomTopic/#. This access key would allow a device to subscribe to that wildcard topic and will receive data for all matching devices.
One caveat to keep in mind is that the MQTT rate limit (2/sec/topic) sill applies. So if that wildcard topic is receiving data for tons of devices, you could quickly exceed that limit.