Spring Integration: Basic Fundamentals

Looking into spring integration for quite a while now.

Spring Integration is a project of SpringSource(duh). The major aim of Spring Integration is to apply the Spring’s core programming model (IoC et.al) into the messaging domain.

The main components of Spring Integration are:

1) Message: It is a generic wrapper for any Java object combined with the metadata to be used by the framework to handle that object. The message is further consisting of header and payload. Payload can be of any type(basically a Java object) and header is for holding the information required for the message to be processed.

2) Message Channel: Message Channel forms the mode of communication between the message producer and consumer. It decouples the message production logic from the message consuming logic. The key point to be noted is that the message channel supports both Point-to-Point and Publish-Subscribe models (for the uninitiated, Point-to-Point model basically means a message has only one consumer processing it even though other consumers might also exist for the same message and Publish-subscribe model basically means a message has multiple consumers processing it simultaneously. To summarize, Point-to-point is unicasting the message whereas Publish-subscribe is broadcasting it). Another important point to be noted here is that while these two models describe how many consumers would ultimately process the message, Spring Integration also allows you whether to have message channel to buffer messages or not. This is important in the scenarios where it might be prudent not to overload the consumer with the messages.

3) Message Endpoint: Message endpoint connects the message and the application code in a non invasive manner. In other words, application code and message need not know the implementation details of each other.

6 thoughts on “Spring Integration: Basic Fundamentals”

  1. Hi MM,

    Message Endpoint would be any class implementing the MDB interface.right?

    Also the fact that most app servers support durable topics and queues, what's so special about the Spring Integration buffering of the message?

    HermesJMS is a great tool to interpret messages on runtime!

    ~rohit.

  2. Hi RK,

    I think you are mixing JMS with Spring Integration here.

    Basically, Spring Integration supports many types of endpoints apart from endpoints implementing interfaces.

    Coming to your second point, since we are having multiple endpoints (including MDB driven endpoints), all endpoint may/may not support durable topics/queues, so buffering might be required.

  3. Yes I was coming from a JMS-specific context, that is why was amused with the Spring buffering feature. 🙂

    ~rohit.

Comments are closed.