The Spring gives a great support to build enterprise applications making the developers more productive and improve the testability and portability of the application. Sprint Integration comes to help in this goal.

Spring Integration extends the Spring programming model into the messaging domain and builds upon Spring’s existing enterprise integration support to provide an even higher level of abstraction. It supports message-driven architectures where inversion of control applies to runtime concerns, such as when certain business logic should run and where the response should be sent. It supports routing and transformation of messages so that different transports and different data formats can be integrated without impacting testability. In other words, the messaging and integration concerns are handled by the framework. Business components are further isolated from the infrastructure, and developers are relieved of complex integration responsibilities. [1]

The Spring follows a layered architecture (vertical perspective) to separate the concerning and to promote a low coupling. The message-drive architecture used by Spring add a horizontal perspective. And they are not mutually exclusive.

The message system has filters and pipes:

  • The filters represent any components capable of producing or consuming messages. Managed within a layer that is logically above the application’s service layer, interacting with those services through interfaces in much the same way that a web tier would.
  • The pipes transport the messages between filters. It should be encapsulated in a layer whose contracts are defined as interfaces.



Main components

  • Message: generic wrapper for any Java object combined with metadata (header + payload)
  • Message Channel: it is the pipe that receive the message from a producer and send to a unique consumer or send the message in a broadcast way.
  • Message Endpoint: It is the filter. It handles the message and it is mapped to message channels. It isolates the application code from the infrastructure. It is part of Enterprise Integration Patterns. Here are types of endpoints:
    • Message Transformer changes the message (content, header or structure)
    • Message Filter verifies is the message can continue its flow or not to the output channel.
    • Message Router selects the right channel to the message.
    • Splitter splits the message and send to its output channel
    • Aggregator receives multiple messages and combine them to a single message.
    • Service Activator connects a service instance to the message system.
    • Channel Adapter connects a message channel to a system or transport


From Spring Doc [2]


Play List

Simple Programming Intertech

References