The behavior of the "last" stream offset #12497
-
Describe the bugThe LAST offset in RabbitMQ Streams is expected to return the first message of the last chunk, according to the official documentation. However, in practice, it consistently returns the last published message, even when multiple chunks are present. This behavior contradicts the documented functionality but aligns with our preferred use case. https://www.rabbitmq.com/blog/2021/09/13/rabbitmq-streams-offset-tracking#the-different-offset-specifications-in-a-stream Reproduction steps
Expected behaviorAccording to the RabbitMQ Stream Core documentation, the LAST offset should return the first message of the last chunk. However, based on our use case, we would prefer that the LAST offset consistently returns the most recently published message, regardless of chunk boundaries. Additional contextWe are using RabbitMQ Stream Core, not the Stream Plugin. Our tests have been conducted with custom stream configurations to force the creation of multiple chunks by adjusting chunk size and message payload. Despite this, the LAST offset consistently returns the last published message rather than the first message of the last chunk. This behavior aligns with our needs, but it contradicts the documentation, and we would appreciate clarification. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@Laurianti we will not guess what your tests do exactly and how do you determine that the message returned is "the last published" and not "the last message in the chunk", or how do you determine that they are not the same message (I'd say with a lot of tests it will be the case). Please provide an executable way to reproduce against RabbitMQ |
Beta Was this translation helpful? Give feedback.
-
Are we supposed to guess what those "custom stream configurations" involved, when they happened w.r.t. publishing, and so on? If you are looking for help from the core team for free, please provide all the details we need to reproduce exactly what your doing, or take the source code and do your own investigation. This is open source software after all. |
Beta Was this translation helpful? Give feedback.
Michael asked for an executable way - please provide it. Otherwise it's not clear what you are doing.
Here's an example showing that I get the whole last chunk (starting from the first message of the last chunk) when consuming over AMQP 0.9.1 and AMQP 1.0:
last
using stream-perf-test - it shows the chunk size of 1740 messages: