I would like to clarify following quoted API docs:
NOTE 1: Currently, a device can publish at rate of about 1 event/sec, with bursts of up to 4 allowed in 1 second. Back to back burst of 4 messages will take 4 seconds to recover.
Whose responsibility to ensure event publish at rate 1 /sec, is it Application or Device OS?
What does burst up to 4 in a second mean? If we are only limited by 1 event/second, doesn't it mean we can't publish 4 event in 1 s? So we can't send burst of 4 events in one second? Do I miss something?
What does " Back to back burst of 4 messages will take 4 seconds to recover." mean?
As long as you publish only once per second, you can publish once per second forever. This is the recommended mode of operation.
However, in limited situations, you can send out more than that. The maximum publish size is 622 characters. Say your application generates 2K of JSON data, but you only want to send it to the cloud every 10 seconds. Since the data is too large to fit in a single publish, you split it into 4 separate publishes. Since that will still fit in the burst rate, you can send them out sequentially, without waiting.
You can’t do that continuously, so you can’t send 5 publishes at once. And you need to wait the recovery period (4 seconds) before you publish again after a burst of publishes.
But in this application, since there are only 4 publishes, 10 seconds apart, you can burst out all 4 publishes quickly, and not have to wait 1 second between each publish, because there is enough time to recover from that.
Thank you @rickkas7 and I apologies for long reply.
So let’s say in my context, at particular time, to publish following 3 different events with its size:
It depends how often you want to send those three events. If you want to send them continuously, publishing event 1 again immediately after sending event 3, then you probably will want to wait 1 second between publishes.
If you will wait more than 3 or 4 seconds before publishing again, you can send all three out without waiting between them.
In the more common case of sending a burst of events periodically, say every 30 seconds or few minutes, you do not need to wait between publish 1 and 2, or between 2 and 3.