Spring Integration Overview

Source: Internet
Author: User
Tags soap xpath rabbitmq enterprise integration patterns

Spring Integration

Extends the Spring programming model to the well-known Enterprise integration Patterns. Spring integration enables lightweight messaging within spring-based applications and supports integration with external s Ystems via declarative adapters. Those adapters provide a higher-level of abstraction over Spring's support for remoting, messaging, and scheduling. Spring integration ' s primary goal is-provide a simple model for building enterprise integration solutions while Maintai Ning the separation of concerns that's essential for producing maintainable, testable code.

Spring integration expands the Spring programming model to support the well-known "Enterprise Integration Model". Spring integration, through a declarative adaptation, makes it possible to build lightweight messages on the support integration of spring applications and external systems. Those adaptations provide a high-level abstraction of the remote, messaging, and scheduling aspects of spring. The main goal of spring integration is to provide a simple model for building "enterprise-integrated solutions" while maintaining isolation of concerns that are critical to generating sustainable, testable code.

Introduction

Using the Spring Framework encourages developers to code using interfaces and use Dependency injection (DI) to provide a P Lain Old Java Object (POJO) and the dependencies it needs to perform its tasks. Spring Integration takes this concept one step further, where POJOs is wired together using a messaging paradigm and individual aware of other components in the application. Such an application was built by assembling fine-grained reusable the components to form a higher level of functionality. With careful design, these flows can is modularized and also reused at a even higher level.

In addition to wiring together fine-grained components, Spring integration provides a wide selection of channel adapters a ND gateways to communicate with external systems. Channel adapters is used for one-way integration (send or receive); Gateways is used for request/reply scenarios (inbound or outbound). For a full list of adapters and gateways, refer to the reference documentation.

The Spring XD Project builds on spring integration, where Spring integration modules is assembled into an XD Stream.

Introduced

Using the spring framework makes it more courageous for developers to use interfaces to program and use dependency injection to provide a "simple Java object (POJO)" with some of the dependent objects it needs to perform its own tasks. Spring INTEGRATIONJ This concept a step further: POJOs that are connected by a message paradigm and some individual components may not be aware of other components in the application. Such an application is created by a reusable component that can be assembled with fine particles to form a higher level of functionality. Through careful design, these flows can be modularized and even reused at a higher level.

In addition to fine-grained components, spring integration offers a wide selection of channel adapters and interaction gateways with external systems. Channel adapters is used to make one-way integration (transmit or receive); Gateways is used in Request/response scenarios (inbound or outbound). For a complete list of adapters and gateways, refer to the appropriate documentation.

The Spring XD project is built on spring integration, and the Spring integration component is assembled into an XD stream.

Features
    • Implementation of the most of the Enterprise integration Patterns
      • Endpoint
      • Channel (point-to-point and Publish/subscribe)
      • Aggregator
      • Filter
      • Transformer
      • Control Bus
      • ...
    • Integration with External Systems
      • Rest/http
      • Ftp/sftp
      • Twitter
      • WebServices (SOAP and ReST)
      • Tcp/udp
      • Jms
      • RabbitMQ
      • Email
      • ...
    • The framework has extensive JMX support
      • Exposing framework components as MBeans
      • Adapters to obtain attributes from MBeans, invoke operations, send/receive notifications

Characteristics:

1. Implementation of most "Enterprise integration models":

    • Endpoint: Endpoint
    • Channel (point-to-point and Publish/subscribe): Channels (Point-to-point and publish/subscribe)
    • Aggregator: Aggregator
    • Filter: Filters
    • Transformer: Converter
    • Control bus: Controlling buses
    • ......

2. Integration with external systems:

    • Rest/http
    • Ftp/sftp
    • Twitter
    • WebServices (SOAP and ReST)
    • Tcp/udp
    • Jms
    • RabbitMQ
    • Email
    • ...

3. This framework provides support for scaling to JMX. (Java Management Extensions, the Java Management extension, is a framework for embedding management functions for applications, devices, systems, and so on.) )

    • Exposes the frame component as a mbeans. ( MBean: In the JMX specification, a management artifact is defined as follows: It is a Java object that represents a management resource, conforms to a certain design pattern, and implements a specific interface defined by that specification.) This definition ensures that all management artifacts represent managed resources in a standard way. )
    • Adapters gets properties from Mbeans, invokes operations, sends/receives notifications.

3. This framework provides support for scaling to JMX. (Java Management Extensions, the Java Management extension, is a framework for embedding management functions for applications, devices, systems, and so on.) )

 

Quick Start

The recommended-to- get started using spring-integration In your project was with a dependency management system–the snippet below can being copied and pasted into your build. Need help? See our Getting Started guides in building with Maven and Gradle

The recommended way to start using spring-integration in your project is to use a dependency management system: The following code snippet can be copied and pasted into your system. For assistance, refer to the Getting Started documentation for MAVEN and Gradle.

  <dependencies> <dependency> <groupi D>org.springframework.integration</groupid> <artifactId> Spring-integration-core</artifactid> <version>4.0.3.release</version> </dependency></DEPENDENCIES>  

In the following "Quick Start" Application the same gateway interface are used to invoke the Completel Y different service implementations. To build and run the need the spring-integration-ws and SPRING-INTEGRATION-XM L modules as described above.

In the Quick Start app below, you can see that the same gateway interface is used to invoke two completely different service implementations. To build and run this program, you need the SPRING-INTEGRATION-WS and sping-integration-xml components that have been described above.

PublicClassMain{PublicStaticvoidMain(String...Args)ThrowsException{ApplicationContextCTx=NewClasspathxmlapplicationcontext("Context.xml");Simple ServiceTempconverterConverter=CTx.Getbean("Simplegateway",Tempconverter.Class);System.Out.println (converter. Fahrenheittocelcius (68.0f//Web Service converter = ctx.< Span class= "NA" >getbean ( "Wsgateway"  Tempconverter.system.. (converter. Fahrenheittocelcius (68.0f}             /span>                
public interface TempConverter {    float fahrenheitToCelcius(float fahren);}
<!--simple Service--<int:gatewayId="Simplegateway"Service-interface="Foo. Tempconverter "Default-request-channel="SimpleExpression"/><int:service-activatorId="Expressionconverter"Input-channel="SimpleExpression"expression="(PAYLOAD-32)/9 * 5"/><!--Web Service--<int:gatewayId="Wsgateway"Service-interface="Foo. Tempconverter "Default-request-channel="Viawebservice"/><int:chainId="Wschain"Input-channel="Viawebservice"><int:transformerexpression= "&lt; FahrenheitToCelsius xmlns= ' http://tempuri.org/' &gt;&lt; Fahrenheit&gt;xxx&lt;/fahrenheit&gt;&lt;/fahrenheittocelsius&gt; '. Replace (' XXX ', payload.tostring ()) "/> <int-ws:header-enricher> <int-ws:soap-action value= "http://tempuri.org/ FahrenheitToCelsius "/> </int-ws:header-enricher>  <int-ws:outbound-gateway uri= "http://www.w3schools.com/webservices/ Tempconvert.asmx "/> <int-xml:xpath-transformer  Xpath-expression= "/*[local-name () = ' fahrenheittocelsiusresponse ']/*[local-name () = ' Fahrenheittocelsiusresult '] "/></INT:CHAIN>     

Spring Integration Overview

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.