Mailbox service
The mailbox service is used to interact with Thing mailboxes.
Understanding Mailboxes
The following handshake diagram shows the three general flows of any mailbox messages within the deviceWISE Cloud
Service | Description | |
---|---|---|
1 | Fire and Forget |
The producer/client will deliver the message to the Mailbox server, with no confirmation from the consumer. The server (broker) confirms the reception of the message to the producer. The consumer on the receiving side does a
|
2 | mailbox.send(with ack) | The producer/client will deliver the message to the Mailbox server. Once the mail items are received by the consumer the Mailbox server sends an ACK to the producer. |
3 | mailbox.send(with auto-ack) | The producer/client will deliver the message to the Mailbox server. The consumer sends an auto-ack along with the mailbox.check and returns the mail items. |
Mailbox Status
The diagram below shows the various statuses of the mailbox and some of the possible status work flows.
The mailbox statuses during different mailbox flow.
Understanding actTimeout and ttl
There are two timeouts that can be specified on all mailbox messages. When a mailbox message is sent, the TR50 client that receives the mail item has the option to reply with data to the sender.
The ackTimeout specifies how long the sender is willing to wait for a reply from the receiving client.
The ttl specifies how long the message should be held in the IoT Portal for delivery to the receiving TR50 client. If the receiving TR50 client is offline at the time the message is sent (the most common scenario) or is otherwise delayed in retrieving mailbox messages, the ttl value is used to indicate how long the M2M Service holds the message.
- ackTimeout of -1 indicates for the command to return immediately and not wait for a reply. The message will be stored in the deviceWISE Cloud depending on the TTL setting.
- ttl of -1 indicates for the
deviceWISE Cloud
to
hold the message "forever" until it can be delivered to
a client.
Note that messages can still be aged out of an account before being delivered depending on your organization's retention settings for the mailbox. - If the "ackTimeout" parameter is specified, but the ttl parameter is not, then the ttl is set to the same value as the ackTimeout.