PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, July 11, 2022

[FIXED] How are message contracts versioned for service buses?

 July 11, 2022     esb, masstransit, message, messagecontract     No comments   

Issue

Let's say we use message contracts based on interfaces, as recommended for MassTransit for example.

First how are those interfaces shared across all the applications? Let's say we provide them in a nuget package. (Is that the way to go?)

So second, how do we now make sure all the applications use the same version?

Should we use new interfaces every time (e.g. messageV1, messageV2) to be backwards compatible? That would require us to send multiple messages at once instead of 1...

Or should we have an upgrade window, where all applications are updated at the same time?


Please check out both the answers and the comments, if you are looking in the same.
Really got some quality feedback here :D


Solution

MassTransit doesn't explicitly support any kind of versioning, so you're left with the freedom to choose to do what you think is best. The assumptions you've made in your question are more or less exactly the way I do things:

  • Contracts are shared as a nuget package across subsystems
  • New interfaces are created when changes need to be made, interfaces are only ever extended with nullable / backwards compatible changes
  • If necessary, multiple messages are published/sent to preserve backwards compatibility
  • When no longer needed, older versions can be obsoleted/removed

It can seem like a lot of work, but if you design things to work that way from the start it's not so bad, and it really pays off.



Answered By - nizmow
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing