You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix MessageVersionStack to work with more than 2 versions (#899)
MessageVersionStack was working strangely when there were more than
two versions of a message. If you have three versions of a message, i.e.
MyMessage, MyMessageV2 and MyMessageV3, you've got a subscriber for each
of them, and publish MyMessageV3, only MyMessageV3 and MyMessage are
received, MyMessageV2 never arrives.
The root of the problem was traced into how versioned exchanges are declared
and bound to each other. The exchange for MyMessageV3 is bound to the
relevant queues and into the exchange of MyMessage, but not into the exchange
of MyMessageV2, which it should do as well.
The reason for this was in MessageVersionStack.GetSupersededType, which
takes a message type and all the ISupersede interfaces that the message
implements, and returns the first in the list (if there are multiple levels
of versions it should return the last). The fix was to change GetSupersededType
to always return the last element in the list, after which it works with
an arbitrary number of message versions.
0 commit comments