We're using implicit streams subscriptions with our own stream provider implemented on top of PersistentStreamProvider, and it seems there's a bug when an implicit consumer re-subscribes to a certain position in the stream.
This is my test scenario:
- 1 producer, 1 implicit consumer
- Producer produces 5 messages
- Consumer finishes consuming all 5 messages
- Consumer unsubscribes and re-subscribes with a sequence token of the 3rd message
Expected result: Messages 3-5 are re-consumed immediately
Actual result: No messages are consumed until a new message is produced. Only if we produce another message (the 6th), the consumer "wakes up" and re-consumes messages 3-5 and then 6.
In explicit streams it works as expected. Note that I've verified all of the 5 messages are still in the QueueCache.
I've dug in the source code and it seems the problem is that with explicit streams, IStreamPubSub's RegisterConsumer method calls the producer (the PersistentStreamPullingAgent in our case) and refreshes the cursors. In the ImplicitStreamPubSub the RegisterConsumer method does nothing.
How can this be solved?
We're using implicit streams subscriptions with our own stream provider implemented on top of
PersistentStreamProvider, and it seems there's a bug when an implicit consumer re-subscribes to a certain position in the stream.This is my test scenario:
Expected result: Messages 3-5 are re-consumed immediately
Actual result: No messages are consumed until a new message is produced. Only if we produce another message (the 6th), the consumer "wakes up" and re-consumes messages 3-5 and then 6.
In explicit streams it works as expected. Note that I've verified all of the 5 messages are still in the
QueueCache.I've dug in the source code and it seems the problem is that with explicit streams,
IStreamPubSub'sRegisterConsumermethod calls the producer (thePersistentStreamPullingAgentin our case) and refreshes the cursors. In theImplicitStreamPubSubtheRegisterConsumermethod does nothing.How can this be solved?