# Mqtt engine and QoS

**URL:** <https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062>\
**Category:** Ignition\
**Created:** [June 25, 2020, 10:54pm UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062 "2020-06-25T22:54:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mau89](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mau89/32/20680_2.png) [@Mau89](https://forum.inductiveautomation.com/u/Mau89)\
**Post date:** [June 25, 2020, 10:54pm UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/1 "2020-06-25T22:54:08Z")

</div>

Hi!  
I am testing mqtt engine module. I want to understand how this module subscribes a topic on broker.  
mqtt specifics define three level of QoS:

- _At most once_ (0)
- _At least once_ (1)
- _Exactly once_ (2)

What qos is used in mqtt engine module? Is it possible to change?

Thanks

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 25, 2020, 11:06pm UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/2 "2020-06-25T23:06:50Z")

</div>

I believe they use QoS 0 (at most once) and it is not configurable. @wes0johnson can confirm maybe.

---

<div class="post-metadata">

**Author:** ![wes0johnson](https://avatars.discourse-cdn.com/v4/letter/w/7ab992/32.png) [@wes0johnson](https://forum.inductiveautomation.com/u/wes0johnson)\
**Post date:** [June 26, 2020, 12:02am UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/3 "2020-06-26T00:02:23Z")

</div>

Kevin is correct - all MQTT Engine subscriptions for Sparkplug topics are on QoS0 per the Sparkplug specification.

---

<div class="post-metadata">

**Author:** ![Mau89](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mau89/32/20680_2.png) [@Mau89](https://forum.inductiveautomation.com/u/Mau89)\
**Post date:** [June 26, 2020, 6:16am UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/4 "2020-06-26T06:16:22Z")

</div>

this for the sparkplug namespace, instead for another namespace or a custom one?  
Is it possible to have certainty to receive all messages in the case of connection problems  
Thank you

---

<div class="post-metadata">

**Author:** ![wes0johnson](https://avatars.discourse-cdn.com/v4/letter/w/7ab992/32.png) [@wes0johnson](https://forum.inductiveautomation.com/u/wes0johnson)\
**Post date:** [June 26, 2020, 5:05pm UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/5 "2020-06-26T17:05:50Z")

</div>

The following is only true for MQTT Engine 3.4.10 or later for Ignition7 and 4.0.4 or later for Ignition8.

We do support QoS1 for custom namespaces. These are the instructions to enable:

- In MQTT Engine ‘General’ Configuration set ‘Custom Properties’ to be the following string: `{"allowCustomNamespacesQos1":true}`

- After setting the Custom Property above, two new configuration options will appear:

- To allow MQTT Engine to subscribe on QoS1 with cleanSession=false, set the following:

---

<div class="post-metadata">

**Author:** ![Mau89](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mau89/32/20680_2.png) [@Mau89](https://forum.inductiveautomation.com/u/Mau89)\
**Post date:** [June 29, 2020, 1:32pm UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/6 "2020-06-29T13:32:28Z")

</div>

I have configured the new options, but it doesn’t seem to work yet. I lost the message when the broker is not accessible.

---

<div class="post-metadata">

**Author:** ![harigobu.gb](https://avatars.discourse-cdn.com/v4/letter/h/b77776/32.png) [@harigobu.gb](https://forum.inductiveautomation.com/u/harigobu.gb)\
**Post date:** [July 19, 2020, 5:37pm UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/7 "2020-07-19T17:37:45Z")

</div>

Hi,

I do have some thing similar doubt with MQTT engine.  
I am using this following function

```auto
system.cirruslink.engine.publish(String serverName, String mqttTopic, byte[] payload, int qos, boolean retain)

```

Where I have used 2 for QoS.

1. Is that right? Will this work?
2. How to verify this?
3. In this page [https://docs.chariot.io/display/CLD79/Gateway+Script+MQTT+Publishing](https://docs.chariot.io/display/CLD79/Gateway+Script+MQTT+Publishing)  
I think they didn’t mentioned what this function will **return**.
4. I need to visually convey that each has been delivered, How to do it?

Thanks.  
-Hari.

---

<div class="post-metadata">

**Author:** ![jdonohue](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jdonohue](https://forum.inductiveautomation.com/u/jdonohue)\
**Post date:** [March 12, 2021, 9:00pm UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/8 "2021-03-12T21:00:12Z")

</div>

Bump this thread - has anyone gotten the QoS 1 to work? I followed Wes’ suggestion on the additions that need to be made to engine, but it is still reporting a QoS of 0. Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![fross](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@fross](https://forum.inductiveautomation.com/u/fross)\
**Post date:** [October 7, 2021, 6:47pm UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/9 "2021-10-07T18:47:21Z")

</div>

I got it working by following @wes0johnson instructions, using Ignition v7.9.18 and Engine v3.4.12.

Beware when copy/pasting Wes’s string in the `Custom Properties` section: because of the formatting used on the forum, the double-quotes are not properly written and the configuration options for QoS1 do not appear.

This should do the trick:  
**`{"allowCustomNamespacesQos1":true}`**

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/0/00da7cbdbaf752b8aaed34964f406dcf0d326466.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/c/ec8f705e0b770191bbfab5d72e9ef24af5b901cb.png)

---

<div class="post-metadata">

**Author:** ![iborwick](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@iborwick](https://forum.inductiveautomation.com/u/iborwick)\
**Post date:** [October 14, 2021, 7:16pm UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/10 "2021-10-14T19:16:29Z")

</div>

Has this been updated since to allow for QoS 2 to be used?

---

<div class="post-metadata">

**Author:** ![wes0johnson](https://avatars.discourse-cdn.com/v4/letter/w/7ab992/32.png) [@wes0johnson](https://forum.inductiveautomation.com/u/wes0johnson)\
**Post date:** [March 28, 2022, 8:47pm UTC](https://forum.inductiveautomation.com/t/mqtt-engine-and-qos/36062/11 "2022-03-28T20:47:51Z")

</div>

QoS2 is not supported at this time.

Also, I should note in order for this to work, the MQTT Client ID in the Engine Server settings must be set to something non-blank. Otherwise, the ‘clean\_session = false’ setting will have no effect because Engine will generate random client ID which defeats the purpose of clean\_session=false.
