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
Listing 22-20. Declaring a bridge in the Spring configuration file
<bridge id=”bridge” input-channel=”stdIn” output-channel=”stdOut”/>
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
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
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: 12162