mp911de / spinach

Scalable Java Disque client
Apache License 2.0
34 stars 4 forks source link

Adopt new Disque Job ID format #18

Closed mp911de closed 8 years ago

mp911de commented 8 years ago

See https://gist.github.com/antirez/e0536fb1dde09dd625fd#gistcomment-1642016 and https://gist.github.com/antirez/786aa7fb2497c2c5d14e

D- | dcb833cf | 8YL1NT17e9+wsA/09NqxscQI | 05a1 | A | $
  1. "D-" is the prefix
  2. dcb833cf is the first 8 bytes of the node ID where the message was generated.
  3. 8YL1NT17e9+wsA/09NqxscQI is the 144 bit ID pesudo random part encoded in base 64.
  4. 05a1 is the Job TTL in minutes. Because of it, message IDs can be expired safely even without having the job representation.
  5. "A" is a byte reserved for future uses. Implementations should never expect it to have a particular value, it may be anything.
  6. "$" signals the end of the ID.