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

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.

主站蜘蛛池模板: 濉溪县| 彩票| 肥东县| 吉隆县| 平罗县| 渭南市| 清涧县| 连平县| 广丰县| 辽中县| 澜沧| 苍溪县| 大石桥市| 昌吉市| 全南县| 武胜县| 朝阳县| 武穴市| 萨迦县| 卢龙县| 禹州市| 城步| 绥芬河市| 贵南县| 新巴尔虎左旗| 留坝县| 门头沟区| 莲花县| 枣阳市| 张家界市| 嘉兴市| 南丰县| 三门峡市| 上高县| 阳原县| 花莲市| 南宫市| 高台县| 肥乡县| 平罗县| 郸城县|