Hi there,
I'm encountering unexpected behaviour using the Go Streams Client library, versions:
- RabbitMQ: 3.13 with management, amqp 1.0, stream, and shovel plugins
Ref docs:
One thing I can't confirm from the RMQ docs is what this stream message timestamp corresponds to? Is it the server's UTC system time when the message was entered into the stream? Can it be set by the client via any of the AMQP 1.0's message parameters such as "MessageProperties.CreationTime"?
Next, how should we exactly use the timestamp offset spec when consuming? My test setup uses a system timezone of UTC with all defaults for the stream config. The producer, consumer, and rabbitmq are all running on the same test system. The test steps are as follows:
1. publish 5 messages at time A (starts at offset 0)
2. Wait 5 minutes, publish another 5 messages at time B (i.e. B ~= A + 5min).
3. Consume using stream.OffsetSpecification{}.Timestamp(int64(timestamp)) where 'timestamp' is the Unix timestamp equivalent of B (I'm assuming this is the correct format based on the RMQ ref link posted above, though there are no comments for this API)
For each message, I set the MessageProperties.CreationTime to the current system time (in UTC). I read this and print it out when consuming.
Expectation: It attaches to the stream around offset 5 (ideally, exactly at that corresponding message)
Observed: It attaches to the beginning of the stream (at offset 0)
The stream metadata (from the "Environment" struct) when consuming is as follows:
&{stats:map[committed_chunk_id:5 first_chunk_id:0 last_chunk_id:5] streamName:events}
Is my expectation valid? Any clarification would be greatly appreciated.
Thank you for taking the time to help me out.