Description
MessageConsumer uses previouslyDeliveredMessages.Add()
When the value exists it won't change that value. Hence the whole algorithm based on previouslyDeliveredMessages won't work atm.
Use assignment instead
previouslyDeliveredMessages[messageId] = X;