欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  资讯频道

Spring Integration 2.0 GA 发布,企业应用集成框架

程序员文章站 2022-03-22 21:44:41
...

近日,Spring Integration 2.0 GA 版发布了。

 

Spring Integration是一个企业应用集成(EAI)框架,是spring编程模型的扩展。该框架提供了简化的方式来解决如消息传递和路由这样的企业应用集成任务。


此版本添加了对Twitter的支持,以下是全部配置:

<twitter:search-inbound-channel-adapter query="spring integration" channel="logger">
    <poller fixed-rate="60000" max-messages-per-poll="50"/>
</twitter:search-inbound-channel-adapter>
  
<logging-channel-adapter id="logger" expression="payload.fromUser + ': ' + payload.text"/>

 

每当新增一个Tweets,这个搜索就会执行,并将此信息发送到logger。代码如下:

public static void main(String[] args) {
     new ClassPathXmlApplicationContext("twitter/context.xml");
 }

 

也许你会觉得不可思议,仅仅几行代码就能实现?你可以在Github上查看这个项目的详情。

或查看更多示例:http://blog.springsource.com/2010/09/29/new-spring-integration-samples/

 

查看2.0版本的详细更新介绍:http://static.springsource.org/spring-integration/docs/2.0.0.RELEASE/reference/htmlsingle/#whats-new-in-2-part