Sunday 16 May 2021

Introduction to Spring Integration

Spring integration is an extension to spring programming model, implements most of the Enterprise integration patterns (https://www.enterpriseintegrationpatterns.com/)

 

What is integration?

Now a days, systems are interconnected to solve a business use case by exchanging the data among them. But data can be exchanged in different ways across different systems like

a.   Applications can use common database to exchange the data

b.   Applications can use traditional FTP protocol to exchange the data

c.    Applications can depend on webservices

d.   Applications can use messaging systems like Kafka, RabbitMQ etc.,

 

Spring integration framework is designed to solve these enterprise integration problems by abstracting the way of data exchange. Since spring integration framework built on spring programming model, you can enjoy all the spring features like auto wiring etc.,

 

Key components of integration framework

There are three main components in any integration framework.

a.   Producer (Sender)

b.   Consumer (Receiver)

c.    Pipe

 

Diagram



Key components of spring integration

In Spring integration, pipes are called as channels, producers and consumers are called as endpoints. Using these endpoints, channels, you can form a complex pipeline.

 


Spring integration framework is built on lightweight message-driven architecture, where messages are exchanged using pipes/channels. In Spring integration framework, endpoints perform the operation and channels/pipes perform the routing.

 

What is a message?

Message contains Header and payload




Types of message channels

a.   Pollable Channel: Buffer the messages and wait the consumer to get the message.

b.   Subscribable channel: Multiple consumers are subscribed to this channel. Whenever a message is arrived, it is delivered to all the subscribers. It do not buffer the messages.

 

Why spring integration?

a.   Enables light weight messaging within spring based applications.

b.   Support integration with external systems via declarative adapters. Adapters are used to connect to multiple systems. Following are some of the core adapters provided by spring integration framework.

1.   Mail (SMTP)

2.   Messaging (JMA, AMQP)

3.   Data store (JDBC, MongoDB, JPA)

4.   File store(FTP, SFTP)

5.   Webservices (SOAP, REST)

6.   Twitter

 

c.    Support routing and transformation of messages

d.   Wide variety of configuration options available.

1.   Configure using annotation

2.   Configure using xml (XML with namespace support, XML with generic “bean” elements).

e.   Support for asynchronous, message-driven behavior is possible.

f.     Since it is built on top of sping core, you can use all the spring features here.

 


Previous                                                    Next                                                    Home

1 comment:

  1. Best tutorial on spring integration on the internet

    ReplyDelete