Spring Integration 2.0 GA 于本月23日正式发布!
自2.0开发至今,Mark Fisher和他的team历时一年,这期间一个发布了7个M版本,几
乎一个半月发布一个M版本,可见SI的活跃程度非同一般。
GA版本亮点功能 点评:
一、对Spring的支持
在路由、转换组件中支持SpEL语言;
二、新增EIP模式
(1) Message History:记录消息的历史轨迹(何时被哪个组件处理过)。和M2版本
不同的是,以前这些记录是在MessageHeader中记录的,会记录下所有的历史记录,而GA版
本中可以通过模式匹配来定义只记录由哪些组件处理过的记录,而不是全部记录。
主要作用:DEBUG和审计(在分布式系统中非常重要,通过它可以查看该消息的轨迹)。
(2)Message Store:存储消息。GA版本中提供2中模式:基于VM和DB。
主要作用:可以记录消息或者消息的副本,记录的内容包括:ID,createTime和
message。在聚会模式和分组模式中可以用到。
弊端:目前这两种方式只是提供了一个简单的功能,但从稳定性(VM)和性能(DB)
上看,如果采用FILE则更好。
(3) Control Bus:管理和监控组件。其实现机制是通过发送消息来管理和监控组件。
三、新增adapter和gateway
(1)开始支持WEB2.0,比如Twitter Adapters和Feed Adapters,WEB2.0的应用如
日中天,这是SI的又一亮点。
(2)支持传统协议XMPP 、FTP/FTPS 以及SFTP Adapters。
(3)支持云端?对云的支持只是个人的期待,但我想SI迟早有这个计划,因为目前
Mule和WSO2 ESB可以接入云端。
SI 2.0 GA版本的新功能概述
来源:http://static.springsource.org/spring-integration/docs/2.0.0.RELEASE/reference/htmlsingle/#whats-new-in-2-part
Part I. What's new in Spring Integration 2.0
For those who are already familiar with Spring Integration, this chapter provides a brief overview of the new features of version 2.0.
Spring Integration 2.0 is built on top of Spring 3.0.5 and makes many of its features available to our users.
You can now use SpEL expressions within the transformer, router, filter, splitter, aggregator, service-activator, header-enricher , and many more elements of the Spring Integration core namespace as well as various adapters. There are many samples provided throughout this manual.
You can now benefit from Conversion Service support provided with Spring while configuring many Spring Integration components such as Datatype Channel . See Section 3.1.2, “Message Channel Implementations” as well Section 7.3.1, “Introduction” . Also, the SpEL support mentioned in the previous point also relies upon the ConversionService. Therefore, you can register Converters once, and take advantage of them anywhere you are using SpEL expressions.
Spring 3.0 defines two new strategies related to scheduling: TaskScheduler and Trigger Spring Integration (which uses a lot of scheduling) now builds upon these. In fact, Spring Integration 1.0 had originally defined some of the components (e.g. CronTrigger) that have now been migrated into Spring 3.0's core API. Now, you can benefit from reusing the same components within the entire Application Context (not just Spring Integration configuration). Configuration of Spring Integration Pollers has been greatly simplified as well by providing attributes for directly configuring rates, delays, cron expressions, and trigger references. See Section 3.2, “Channel Adapter” for sample configurations.
Our outbound HTTP adapters now delegate to Spring's RestTemplate for executing the HTTP request and handling its response. This also means that you can reuse any custom HttpMessageConverter implementations. See Section 13.3, “Http Outbound Gateway” for more details.
Also in 2.0 we have added support for even more of the patterns described in Hohpe and Woolf's Enterprise Integration Patterns book.
We now provide support for the Message History pattern allowing you to keep track of all traversed components, including the name of each channel and endpoint as well as the timestamp of that traversal. See Section 8.2, “Message History” for more details.
We now provide support for the Message Store pattern. The Message Store provides a strategy for persisting messages on behalf of any process whose scope extends beyond a single transaction, such as the Aggregator and Resequencer. Many sections of this document provide samples on how to use a Message Store as it affects several areas of Spring Integration. See Section 6.3, “Claim Check” , Section 3.1, “Message Channels” , Section 5.4, “Aggregator” , Chapter 17, JDBC Support , and Section 5.5, “Resequencer” for more details
We have added an implementation of the Claim Check pattern. The idea behind the Claim Check pattern is that you can exchange a Message payload for a "claim ticket" and vice-versa. This allows you to reduce bandwidth and/or avoid potential security issues when sending Messages across channels. See Section 6.3, “Claim Check” for more details.
We have provided implementations of the Control Bus pattern which allows you to use messaging to manage and monitor endpoints and channels. The implementations include both a SpEL-based approach and one that executes Groovy scripts. See Section 8.3, “Control Bus” and Section 7.5.2, “Control Bus” for more details.
We have added several new Channel Adapters and Messaging Gateways in Spring Integration 2.0.
We have added Channel Adapters for receiving and sending messages over the TCP and UDP internet protocols. See Chapter 16, TCP and UDP Support for more details. Also, you can checkout the following blog: TCP/UDP support
Twitter adapters provides support for sending and receiving Twitter Status updates as well as Direct Messages. You can also perform Twitter Searches with an inbound Channel Adapter. See Chapter 22, Twitter Adapter for more details.
The new XMPP adapters support both Chat Messages and Presence events. See Chapter 25, XMPP Support for more details.
Inbound and outbound File transfer support over FTP/FTPS is now available. See Chapter 12, FTP/FTPS Adapters for more details.
Inbound and outbound File transfer support over SFTP is now available. See Chapter 20, SFTP Adapters for more details.
We have also added Channel Adapters for receiving news feeds (ATOM/RSS). See Chapter 10, Feed Adapter for more details.
With Spring Integration 2.0 we've added Groovy support allowing you to use Groovy scripting language to provide integration and/or business logic. See Section 7.5, “Groovy support” for more details.
These symmetrical transformers convert payload objects to and from a Map. See Section 6.1, “Transformer” for more details.
These symmetrical transformers convert payload objects to and from JSON. See Section 6.1, “Transformer” for more details.
These symmetrical transformers convert payload objects to and from byte arrays. They also support the Serializer and Deserializer strategy interfaces that have been added as of Spring 3.0.5. See Section 6.1, “Transformer” for more details.
The core API went through some significant refactoring to make it simpler and more usable. Although we anticipate that the impact to the end user should be minimal, please read through this document to find what was changed. Especially, visit Section 5.1.3, “Dynamic Routers” , Section 7.2, “Inbound Messaging Gateways” , Section 13.3, “Http Outbound Gateway” , Section 4.1, “Message” , and Section 5.4, “Aggregator” for more details. If you are depending directly on some of the core components (Message, MessageHeaders, MessageChannel, MessageBuilder, etc.), you will notice that you need to update any import statements. We restructured some packaging to provide the flexibility we needed for extending the domain model while avoiding any cyclical dependencies (it is a policy of the framework to avoid such "tangles").
With Spring Integration 2.0 we have switched our build environment to use Git for source control. To access our repository simply follow this URL: http://git.springsource.org/spring-integration . We have also switched our build system to Gradle .
With Spring Integration 2.0 we have decoupled the samples from our main release distribution. Please read this blog to get more info New Spring Integration Samples We have also created many new samples, including samples for every new Adapter.
There is an amazing new visual editor for Spring Integration included within the latest version of SpringSource Tool Suite. If you are not already using STS 2.5.1, please download it here: STS
We have started working on Spring Integration ROO support, and plan to have a first milestone release soon. You can follow its development here: Spring Integration Roo Add-on .