Question

I'm new in using messaging system as a middleware between applications and I'm trying to get few concepts clear, amongst which is the format of the message. I assume there is no right answer here, but could you share your experience of how can this be done, and what are pros and cons?

Was it helpful?

Solution

The kind of messages which work best in my opinion are Commands and Events.

A command message is a message which is sent from one system directly to another system, and it is an instruction for something to happen. Here are some example commands:

  1. Issue Risk To Coverholder
  2. Process Renewal Request
  3. Begin Employee On Boarding

An event message is broadcast, or published by one system to all interested systems, and is a notification that something has happened. Here are some example events:

  1. Policy Document Received
  2. Quote Decision Completed
  3. Financial Transaction Parked

What you notice about these commands and events is that they have business meaning. So the messages which represent these commands and events are easily understood by name.

Try avoiding using CRUDy language (eg create, update, delete, etc)in the naming of your commands and events.

I think this is the best policy when it comes to messaging.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top