hreinhardt/amqp

x-stream-offset is 64bit unsigned

Closed this issue · 2 comments

woffs commented

According to https://groups.google.com/g/rabbitmq-users/c/8hM1QbabK0c x-stream-offset is 64bit unsigned. In https://hackage.haskell.org/package/amqp-0.22.2/docs/Network-AMQP-Types.html#t:FieldValue I find FVInt64 (signed) but no type for Word64 (unsigned). I wonder what's the correct declaration for a x-stream-offset consumer argument (although FVInt32 and FVInt64 work fine here, within their limits).

I found a list of all RabbitMQ data-types here (in section 3): https://www.rabbitmq.com/amqp-0-9-1-errata.html

So it does seem that there are data-types for unsigned integers. But I don't remember why I didn't implement them...

Importantly, according to that list, RabbitMQ seems to not support the "Unsigned 64-bit" variant (the third column is empty). So I'm not sure if the email you linked to is correct.

In general, the situation with data-types is a little messy, since RabbitMQ partially deviates from the spec.

woffs commented

Thank you for investigation, I suppose, according to note B in errata.html, that rabbitmq just uses 64bit signed. I'll therefore stay with Int64 and bet that there will not be 10¹⁹ messages in a stream so soon 😉