Spring Integration 5.0 Release Candidate 1 可用

发布 | Artem Bilan | 2017年11月01日 | ...

我谨代表 Spring Integration 团队,很高兴地宣布 Spring Integration 5.0 版本 (5.0.0.RC1) 的 Release Candidate 1 版本现已可用。

可以从 Milestone Repository 下载。

repositories {
    maven { url 'http://repo.spring.io/libs-milestone' }
}

compile "org.springframework.integration:spring-integration-core:5.0.0.RC1"

20 个 JIRA 问题(以及一些 GitHub 问题)包含在此版本中,同时还包含 bug 修复和一系列新功能。以下是自上次宣布的 Milestone 7 以来 RC1 版本的一些功能亮点:

  • 由 Java DSL 解析器填充的组件现在作为 BeanDefinitions 注册到应用程序上下文中,这得益于 Spring Framework 5.0 中新引入的基于 Supplier 的程序化 bean 注册。这种方法有助于我们避免一些单例注册和初始化的样板代码。此外,这种 BeanDefinition 注册在某些用例中可能很有用,例如选择应用程序上下文中的特定组件。事实上,这正是 Spring Cloud Function 项目中用于 java.util.function.* bean 扫描的方式。

  • IntegrationFlows.from(Class<?> serviceInterface) 现在有一个重载版本,包含一个额外的 beanName 参数。这将成为生成的网关代理的 bean 名称,覆盖 [flowId].gateway 值。

    @Bean public IntegrationFlow uppercaseFlow() { return IntegrationFlows.from(MessageFunction.class, "uppercase") .<String, String>transform(String::toUpperCase) .get(); }

这在上面提到的 Spring Cloud Function 中也很有用,当我们通过 bean 名称将函数暴露为微服务的入口点时。同样,这对于通过 IntegrationFlowContext 手动注册的集成流也很方便,当我们有一个“丑陋”的、为 IntegrationFlow 生成的 bean 名称时。

  • HTTP 入站端点(包括 WebFlux)现在能够正确处理回复消息中的 ResponseEntity

    @Bean public WebFluxInboundEndpoint errorInboundEndpoint() { WebFluxInboundEndpoint endpoint = new WebFluxInboundEndpoint(); RequestMapping requestMapping = new RequestMapping(); requestMapping.setPathPatterns("/error"); endpoint.setRequestMapping(requestMapping); endpoint.setRequestChannelName("errorServiceChannel"); return endpoint; }

    @ServiceActivator(inputChannel = "errorServiceChannel") public ResponseEntityprocessHttpRequest() { return new ResponseEntity<>("<500 Internal Server Error,{}>", HttpStatus.INTERNAL_SERVER_ERROR); }

这样,我们就将 Spring Integration Channel Adapters for Web 与 Spring MVC 和 Spring WebFlux 中现有的行为保持一致了。

  • 除了升级到最新的 Spring Web Services 3.0Smack 4.2.1,我们还修复了 Spring Integration Web Services Gateways 中对 DOM POX 消息的处理。

  • 一些 Leader Initiators 现在可能会在无法获取共享资源的锁时发出 OnFailedToAcquireMutexEvents。这种情况经常发生,请参阅 LockRegistryLeaderInitiator#setPublishFailedEvents() 以获取更多信息。

  • 现在可以为 JdbcChannelMessageStore 提供自定义的 MessageGroupPreparedStatementSetter,以适应某些非标准的消息存储结构或不同于默认 Java 序列化行为的情况。

  • 引入了 ClientStompEncoder,以便在使用客户端的 StompSubProtocolHandler 时能够正确填充 SEND STOMP 帧。

特别感谢几位社区成员对框架的持续积极贡献;请 扫描提交记录 并为他们点赞!

有关 5.0 版的完整变更列表,请参阅参考手册的 新增功能 章。

我们预计将在几周内发布 GA 版本——正好赶上 Spring Boot 2.0 GA

重要

我以及 Spring 团队的大部分同事将在 Spring One Platform 上就 Spring Integration 的这些新功能进行演讲。所以请立即注册!

欢迎通过合适的沟通渠道提出任何反馈、功能建议、批评、Bug 报告和疑问!

项目主页 | JIRA | 贡献指南 | 帮助 | 交流

获取 Spring 新闻通讯

通过 Spring 新闻通讯保持联系

订阅

领先一步

VMware 提供培训和认证,助您加速进步。

了解更多

获得支持

Tanzu Spring 提供 OpenJDK™、Spring 和 Apache Tomcat® 的支持和二进制文件,只需一份简单的订阅。

了解更多

即将举行的活动

查看 Spring 社区所有即将举行的活动。

查看所有