So, how big is a message? What all should you include in a message? What if you are in a bigger company, how do you roll messaging out across an enterprise? Honestly, I am still learning here too, but here are some rules of thumb I have picked up along the way:
- You want more than one uber message for the whole company
You want a canonical message model (this means that messages aren’t tied to any one application)
- This one I am still not 100% sure on, but I am pretty sure its correct
- Each message should be a distinct unit or event
- It should represent a business transaction as an atomic, self-contained and self describing unit of work (don’t pass primary keys around)
- Don’t worry about the size of the message unless you have to. I don’t even think about it anymore. The size (bytes) of the message should be considered as it can affect how fast your message can go across the wire. If this level of speed isn’t a concern, then I wouldn’t worry about it. ie if you can wait 0.10 of a second or more than I wouldn’t sweat it.
Fine grained messages create more overhead from a management perspective so each one needs to earn its place.
- Build a way to track your messages. Even if its in excel.
- Once a message is deployed, be careful about upgrades. I try to follow Udi’s advice that instead of modifying the message I make a new one.
- Make sure that only one system / department owns the message. This will make changes a bit clearer to see who can initiate them.