In this article, we will learn about message term in Spring Integration
In order to loose coupling between components in a system, we typically apply the messaging system to achieve that aim. That requires a solid understanding of what is a message and some type of message for effective use for specific scenarios. So in this article, I would like to share the definition of the message, the structure of a message, and common types of messages in a messaging system.
What is a message in a messaging system?
As the spring integration reference document defined that “In Spring Integration, a message is a generic wrapper for any Java object combined with metadata used by the framework while handling that object. It consists of a payload and headers”
The message header provides the metadata of the message provided by the sender and might be used during the transfer, or for routing the message.
Another part of a message is the message payload, it provides the actual content of the message the sender wants to send and it can be of any type, such as structured text or binary data,...
Message in Spring Integration is similar to mail, we have to provide the required information for the mail to be sent such as the name of the sender, the name of receiver, postal code, or how it might return in case the message can not be sent.
To illustrate, see how the Spring team abstracts the Message
Common types of message in the messaging system
Based on the message intent, the message is categorized into three types:
- Command Message
- Document Message
- Event Message
The command message used when an application needs to invoke functionality provided by other applications.
The document message used when an application would like to transfer data to another application.
And the scenario for the last message type is event-notification.
By now, we have learned about the message in the messaging system and have introduced some types of messages based on message intent. I would like to provide you some great resources that might help you deep-dive into the messaging system.
Overview of Spring Integration Framework
When using XML configuration, to avoid getting false schema validation errors, you should use a "Spring-aware" IDE…
Enterprise Integration Patterns - Introduction to Message Construction
In Introduction to Messaging Systems , we discussed Message . When two applications wish to exchange a piece of data…
Affiliated Amazon Book Link: Enterprise Integration Patterns