Spring Book – Chapter 20 – Spring Integration


Message endpoint that connects two channels or channel adapters together. Listing 22-20 below shows declaring a bridge in the Spring configuration file.

In EAI, message bridge can be pictorially represented as shown in Figure 22-27 below.

Figure 22-27. Message Bridge

Figure 22-27. Message Bridge

Listing 22-20. Declaring a bridge in the Spring configuration file

Creating Custom Adapter

Spring out-of-the-box provides adapters for most common communication protocols and systems. However, Spring also allows you to write your own adapters if you require one in your application with ease. Please do not consider this as an advertisement for this book reference, but I feel referring to Chapter 15 of Book titled, “Pro Spring Integration”, published by Apress, would be the ideal way to go forward.

Spring Integration Architecture

Having understood the main components consisting Spring Integration in previous section, we can bring those components together as shown in Figure 22-28, which represents the Spring Integration architecture.

Figure 22-28. Spring Integration high-level architecture

Figure 22-28. Spring Integration high-level architecture

STS Support

SpringSource Tool Suite (STS) provides several features that are especially exciting for Spring Integration users. STS 3.x.x adds support for Spring Integration 2.1, improves the visualization capabilities for Spring Integration flows, and adds support for all newly added Spring Integration adapters like Redis, Gemfire, AMQP and Stored procedure.

In addition to that, all existing Spring Integration adapters have been updated to support new visualization elements.

Templating is one of the important features of STS. Good news is that STS now comes up with templating support for Spring Integration projects as well using Spring Template Project Wizard.

Message Channel Implementations

Message Channel can be broadly classified as shown in Figure 22-29 below.

 Figure 22-29. Message Channel implementation classification

Figure 22-29. Message Channel implementation classification

Table 22-2 below shows MessageChannel implementations grouped accordingly.

Table 22-2. MessageChannel implementation classes




SubscribableChannel DirectChannel Direct point-to-point channel
PublishSubscribeChannel Broadcasts any message send to it to all the subscribed handlers. Publish/subscribe channel with optional TaskExecutor. Intended to send only.
ExecutorChannel Point-to-point with TaskExecutor
PollableChannel QueueChannel Wraps a First-in-First-out buffering queue
PriorityChannel Queue channel which stores messages in priority-ordered
RendezvousChannel Queue channel with zero-capacity which ensures handoff
NullChannel Simply logs any message sent to it at DEBUG level and returns immediately

Note: The Figure 22-1 is not a class diagram depicting various class/interface dependencies. It only shows the classification of message channel according to its implementation. Covering these channels in more detail is not in scope of this book.

Page Visitors: 13409

The following two tabs change content below.
Tomcy John

Tomcy John

Blogger & Author at javacodebook
He is an Enterprise Java Specialist holding a degree in Engineering (B-Tech) with over 10 years of experience in several industries. He's currently working as Principal Architect at Emirates Group IT since 2005. Prior to this he has worked with Oracle Corporation and Ernst & Young. His main specialization is on various web technologies and acts as chief mentor and Architect to facilitate incorporating Spring as Corporate Standard in the organization.
Tomcy John

Latest posts by Tomcy John (see all)

2 thoughts on “Spring Book – Chapter 20 – Spring Integration

  1. Hi,
    Thanks for this blog and information sharing!
    I have one question from Spring Integration. Just thought of checking with you.
    I have SimplewebserviceOutBoundGateway. I need to send a document / attachment to the webservice. How will i achieve that?
    This is my current gateway configuration:

    Please let me know, if you can throw some light in this area.
    Thanks in Advance!

  2. Hi,
    Thank you for your information sharing.
    I have one doubt,could you please suggest me the correct frameworks to address that issue.

    My requirement is I would like to get and process files using spring and camel.


Leave a Reply

Your email address will not be published. Required fields are marked *