Tuesday, 1 June 2021

Integations with Spring

What is Spring Integration?

  • Framework allows to do the following:
    • Allows communication between components within your application, based on in-memory messaging. This allows these application components to be loosely coupled with each other, sharing data through message channels.
    •  It allows communication with external systems. You just need to send the information; Spring Integration will handle sending it to the specified external system and bring back a response if necessary. Of course, this works the other way round; Spring Integration will handle incoming calls from the external system to your application. 
  • Benefits
    • Loose coupling among components.
    • Event oriented architecture.
    • The integration logic (handled by the framework) is separated from the business logic.
  •  
  • Integration is exchange of data between systems(both internal & external)
  • Integration is a common requirement and rapidly increasing
  • Raise of apis has pushed over this requirement of data exchange

Designed to support enterprise integration patterns

Traditional ways of integration

  • Webservices
  • File transfer
  • Database sharing

Spring provides solution to extract information thru use of trusted enterprise integration patterns. This helps your application to be robust, flexible & consistent.

Common Implementations

  • Enterprise Service Bus(ESB)
    • Bus between applications. Applications are decoupled 
    • Heavy weight
  • Integration frameworks
    • Lightweight
    • Point-point connections for simple solutions

Benefits of Spring Integration

  • Simplify complex enterprise integrations
  • Loosely couple components
  • Well defined boundaries between extension points
  • Separate integration and business logic

Architecture

  • Light weight message driven architecture
  • Channels, messages & end points for internal communication
    • Channels do the routing & end point do the operations(Similar to pipes and filters)
  • When communicating with External systems we use special end points called Adapters or Gateways. These sit on the edge of our applications
  • Adapters facilitate communication between systems
    • Available adapters
      • Data store
      • File store
      • HTTP
      • Mail
      • Messaging
      • Twitter
      • Webservices

Channels

  • Pollable
  • Subscribable
  • MessageChannel(Retains message in buffer until subcriber receives it.
    • PollableChannel
    • Direct
    • PublishSubscribe-> one - many
  • QueueChannel
  • PriortyChannel
  • DirectChannel
  • Router
    •  Route message thru channel to end points based on payload type(payload-type-router)
    • Route based on Header value
    • Route based on Receipent list

  • Filter
  • Splitter
    • split message into more than one
  • Aggregator
    • Combines multiple messages into single
  • Bridge
    •  

Spring Integration

  •  Integration Drivers

Messaging API

External System Integration


Adapter and gateways-

  • Adapters are one way communications
  • Gateway- two way communication

Filesystem integration

FTP Integration

  • transfer file from client to server thru established connection
  •  
External System Integration 
  • Filesystem - Log aggregation
  • ftp -
  • database
  • JMS
  • http

No comments:

Post a Comment