Closed jcookems closed 11 years ago
Based on discussion with Service Bus team today, Service Bus does have strong ordering guarantees. How does this new information affect the concerns here?
If we do still need to implement a fix here, I'd lean towards a timeout of some sort - if an expected message doesn't come in after say 10 seconds, it's probably not going to.
Not an issue
The
messagesequencer
assumes that there will be no gaps in the sequence of messages from the subscription for a given node. This allows it to ensure strong ordering.However, this guarantee comes at a price: is a single message is missing from the stream, the sequencer will backup forever, consuming more and more memory.
I can think of two situations where this could happen:
1,2,4,3,5,6
. If the subscription is hooked up after message4
leaves the topic, then the subscription would have these messages:3,5,6,...
.3,5,6,...
Both cases seem unlikely, but they both have devistating consequences:
Two fixes I can think of are:
pendingMessages
list to something like 10. After that point, we should assume that the message we are blocking on will not come, and just give up on it (but log the failure!), and move on to the next one.