Spring Integration is a lightweight framework for developing integration solutions. It extends the programming model of the Spring Framework with abstractions for the integration of systems and applications.
Spring Integration provides plenty of powerful components that can greatly enhance system and process interconnectivity within an enterprise architecture. It embodies some of the finest and most popular design patterns, helping developers to avoid rolling their own.
Spring Integration is driven by the following objectives:
- Provide a basic model for applying diverse approaches to enterprise integration.
- Facilitate message-driven, asynchronous behavior within a Spring-based application.
- Promote intuitive, incremental acceptance for existing Spring users.
The Principles of Spring Integration are:
- Modularity and testability of components should be loosely coupled.
- The framework should enforce a separation of concerns between the logic of enterprise and integration.
- In order to promote reuse and portability, the extension points should be abstract in nature (but within well-defined limits).
A message is a generic wrapper for any Java-object combined with metadata. It includes a payload and headers. The payload can be of any type, and the headers hold information that is commonly required. Headers are also used for the transfer of values from and to connected transports. For example, the name of the file may be stored in a header that downstream components will access.
A message channel is the pipe in an architecture of pipes-and-filters. Producers send messages to a channel, and a channel sends messages to consumers. Therefore, the message channel decouples the messaging components, and also provides a convenient point for message interception and monitoring.
A channel of messages may follow either point-to-point or publish-subscribe communication model. With a point-to-point, any message sent to thechannel can be received by no more than one consumer. In comparison, publish-subscribe channels tend to transmit each message on the channel to all subscribers. Both models are supported by Spring Integration.
One of Spring Integration's primary goals is to simplify the development of enterprise integration solutions through inversion of control. This means you shouldn't have to directly implement consumers and producers and you shouldn't even have to create messages and invoke sending or receiving operations on a message channel. Instead, you should be able to concentrate on your particular domain model with a plain object based implementation. You can then "connect" your domain-specific code to the messaging infrastructure provided by Spring Integration, by providing declarative configuration. The components responsible for those connections are messages endpoints.