红联Linux门户
Linux帮助

Spring Integration 5.0.0.M6发布

发布时间:2017-07-26 09:13:05来源:红联作者:baihuo
Spring Integration 的第六个里程碑版本 5.0 (5.0.0.M6)发布了。Spring Integration 能在基于 Spring 的应用中进行简单的消息通信,并通过简单的适配器与外部系统集成。这些适配器提供了一个更高级别的抽象,超越了 Spring 对远程调用、消息和调度的支持。其主要目标是在保持关注点分离的同时,为构建企业集成解决方案提供一个简单的模型,该模型对产出可维护、可测试的代码来说是必不可少的。

这个版本中有19 JIRAs(和一些GitHub问题),包括错误修复和一些新功能。M46 相比于M5 有如下亮点:

The Spring WebFlux based Reactive Channel Adapters are provided for the HTTP server side:[code]@Bean
public IntegrationFlow sseFlow() {
return IntegrationFlows
.from(Http.inboundReactiveGateway("/sse")
.requestMapping(m -> m.produces(MediaType.TEXT_EVENT_STREAM_VALUE)))
.handle((p, h) -> Flux.just("foo", "bar", "baz"))
.get();
}[/code]This sample demonstrate how we can configure Server Side Events with the Spring Integration Channel Adapter which is fully based on the WebFlux foundation and performs integration flow execution on demand, back-pressure manner.

The IntegrationFlow can now start from any interface, even without @MessagingGateway annotation. That annotation is synthesized on background with default properties by the AnnotationGatewayProxyFactoryBean. This trick opens for us possibility to start IntegrationFlow from the java.util.function interfaces - Function, Consumer and Supplier. And that, in turn, gives us an interesting approach where we can expose an IntegrationFlow as a Function using new Spring Cloud Functionproject:[code]@Bean
public IntegrationFlow uppercase(MongoOperations mongoOperations) {
return IntegrationFlows.from(Function.class)
.handle(MongoDb.outboundGateway(mongoOperations)
.queryFunction(msg ->
Query.query(Criteria.where("name")
.is(msg.getPayload())))
.collectionNameExpression("headers.collection")
.expectSingleResult(true)
.entityClass(Person.class))
.get();
}[/code]a new JdbcMetadataStore is available now. This implementation is truly transaction-based and if subsequent flow after (S)FTP polling causes some error, no entries is stored in the DB because of transaction rollback.

The preserveTimestamp algorithm for (S)FTP Inbound Channel Adapters has been fixed to throw an exception when local temporary copy cannot be renamed to the original file because the last one is busy in another process.

软件详情:https://spring.io/blog/2017/07/25/spring-integration-5-0-milestone-6-available

来自:开源中国社区
文章评论

共有 0 条评论