官术网_书友最值得收藏!

How does message versioning work?

Let's stop for a second and think about what's happening here. When we publish a message, EasyNetQ usually creates an exchange for the message type and publishes the message to that exchange:

Subscribers create queues that are bound to the exchange and therefore receive any messages published to it:

With message versioning enabled, EasyNetQ will create an exchange for each message type in the version hierarchy and bind those exchanges together. When you publish the MyMessageV2 message, it will be sent to the MyMessageV2 exchange, which will automatically forward it to the MyMessage exchange.

When messages are serialized, EasyNetQ stores the message type name in the type property of the message properties. This metadata is sent along with your message to any subscribers, who can then use it to deserialize the message.

With message versioning enabled, EasyNetQ will also store all the superseded message types in a header in the message properties. Subscribers will use this to find the first available type that the message can be deserialized into, meaning that even if an endpoint does not have the latest version of a message, so long as it has a version, it can be deserialized and handled.

主站蜘蛛池模板: 永善县| 会同县| 丰镇市| 太康县| 西畴县| 古丈县| 曲阳县| 拉孜县| 双牌县| 凌源市| 平陆县| 惠来县| 锦州市| 喜德县| 石泉县| 大方县| 滨海县| 榆林市| 蓬莱市| 灵寿县| 高密市| 古蔺县| 固阳县| 耒阳市| 尉犁县| 达拉特旗| 溧水县| 巴彦县| 增城市| 横山县| 海安县| 文安县| 辛集市| 疏附县| 山丹县| 剑阁县| 平果县| 肥城市| 台前县| 彰武县| 泾川县|