Follow

Message IDs and ordering

Ardexa Agent v2.2.0 introduces two major changes:
  • All telemetry events now include a "Message ID" property
    • The message ID is a string containing a 64-bit integer
    • The integer is incremented for each new message
    • The last used ID is cached to disk in case the agent is restarted
    • If the cached number is removed or a new machine is used to replace a broken one, then the Message ID sequence will start again from ZERO (i.e. a message ID of ZERO means the sequence has been reset)
  • All telemetry events will now be sent in order
    • Any backtracking (receiving a previous message ID) means that there were transport problems and the agent is resending the message sequence
    • If the message ID jumps forward, any messages in between are lost e.g. a power outage
AMQP guarantees ordering under the following conditions (from http://www.rabbitmq.com/semantics.html#ordering)
 
messages published in one channel, passing through one exchange and one queue and one outgoing channel will be received in the same order that they were sent
 
All the publishing and routing conditions are met, so as long as you only use one outgoing channel, i.e one consumer, then all the messages will arrive in order, verifiable using the Message ID.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.