Managing and using MyQttHub Stashing: storing MQTT messages matching filters


#1

MyQtthub Stashing introduction

Stashing function allows to create an ordered storage for incoming PUBLISH messages. Only messages matching configured filter will be stashed.

By creating a Stash and Stashing Messages, you are creating an ordered message log that records matching messages (filters using that stash). Together with the message is also stored when it was received, source IP and additional data.

This ensures you will not lose any message, even in the case with hardware problems with MQTT receivers.

From this stash you can, for example, replay (re-send) these messages so you can easily trigger action associated to that message, know its reception time, etc.

Creating a Stash

  1. To start stashing you have to create a stash first. This done by clicking on top menu:
    image

  2. Then click on “Stashes”:
    image

  3. Then click to add a stash:
    image

  4. Now define a stash unique name and some description:
    image

Now you have your Stash created you need to tell MyQttHub engine what messages to stash. This is done by creating a filter rule using that stash with limit-PUBLISH rule type.

Now click on stash tab and configure stash to use:
image

Note that we have configured rule with limit-PUBLISH. This is because Stashing function only activates on PUBLISH reception. Note also we have configured priority 5 and permission/action to “Dunno/continue”. This is because we want with this rule to stash everything matching without considering if that message will be accepted or discarded by a further rule.

As you can see, you can configure a stashing filter at the end of your rule-chain or at the top (creating different results). You can also activate Stashing only for denied topics or just stash all accepted messages.

Now, publish a list of messages matching the stash you have created. In this example we are stashing messages matching with test/message/#. For this purpose publish 3 messages with topic test/messages/1, 3 more with topic test/messages/2 and 3 more with topic test/messages/3.

Now check stash to see how messages were stored in the order they were received.

How to list messages stored in a given stash with MyQttHub

  1. Go to stashes and click on the envelope:
    image

  2. Now you will see stashed messages: