I am getting some unexpected behavior when playing around with the initial position of a consumer. From the docs:
"latest" = LIFO queue
"earliest" = FIFO queue.
The thing I am seeing is:
"Latest" ignores all messages before a subscription is created. It then becomes a FIFO queue from, the point the subscription is created. See the output below when using "latest" on a consumer, see that the IDs and publish timestamps show FIFO behavior.
receiving message
<pulsar.Message object at 0x7f011ec92220>
Received message 'b'Hello-10-lifo-v3'' id='(15537,40,-1,-1)' time='0' publish_time='1631809207044'
receiving message
<pulsar.Message object at 0x7f011ebfa310>
Received message 'b'Hello-9-lifo-v3'' id='(15537,41,-1,-1)' time='0' publish_time='1631809207165'
receiving message
<pulsar.Message object at 0x7f011ec92220>
Received message 'b'Hello-8-lifo-v3'' id='(15537,42,-1,-1)' time='0' publish_time='1631809207256'
receiving message
<pulsar.Message object at 0x7f011ebfa310>
Received message 'b'Hello-7-lifo-v3'' id='(15537,43,-1,-1)' time='0' publish_time='1631809207307'
receiving message
<pulsar.Message object at 0x7f011ec92220>
Received message 'b'Hello-6-lifo-v3'' id='(15537,44,-1,-1)' time='0' publish_time='1631809207396'
receiving message
<pulsar.Message object at 0x7f011ebfa310>
Received message 'b'Hello-5-lifo-v3'' id='(15537,45,-1,-1)' time='0' publish_time='1631809207463'
receiving message
<pulsar.Message object at 0x7f011ec92220>
Received message 'b'Hello-4-lifo-v3'' id='(15537,46,-1,-1)' time='0' publish_time='1631809207512'
receiving message
<pulsar.Message object at 0x7f011ebfa310>
Received message 'b'Hello-3-lifo-v3'' id='(15537,47,-1,-1)' time='0' publish_time='1631809207608'
receiving message
<pulsar.Message object at 0x7f011ec92220>
Received message 'b'Hello-2-lifo-v3'' id='(15537,48,-1,-1)' time='0' publish_time='1631809207675'
receiving message
<pulsar.Message object at 0x7f011ebfa310>
Received message 'b'Hello-1-lifo-v3'' id='(15537,49,-1,-1)' time='0' publish_time='1631809207723'
When using "earliest" I am getting true FIFO queue, where all messages since the start of the topic are received in FIFO. Output is basically the same as above in terms of id and publish timestamp.
Is this the expected behavior?
Thanks!