Java DSL for Spring Integration 1.2 Milestone 2 发布了,目前迭代更新的一些亮点:
JPA support[code]@Autowired
private EntityManagerFactory entityManagerFactory;
@Bean
public IntegrationFlow pollingAdapterFlow() {
return IntegrationFlows
.from(Jpa.inboundAdapter(this.entityManagerFactory)
.entityClass(StudentDomain.class)
.maxResults(1)
.expectSingleResult(true),
e -> e.poller(p -> p.trigger(new OnlyOnceTrigger())))
.channel(c -> c.queue("pollingResults"))
.get();
}
@Bean
public IntegrationFlow updatingGatewayFlow() {
return f -> f
.handle(Jpa.updatingGateway(this.entityManagerFactory),
e -> e.transactional(true))
.channel(c -> c.queue("persistResults"));
}
@Bean
public IntegrationFlow retrievingGatewayFlow() {
return f -> f
.handle(Jpa.retrievingGateway(this.entityManagerFactory)
.jpaQuery("from Student s where s.id = :id")
.expectSingleResult(true)
.parameterExpression("id", "payload"))
.channel(c -> c.queue("retrieveResults"));
}[/code]Mid-flow transaction support
Scatter-Gather support
More routers improvements
发行说明:
https://spring.io/blog/2016/09/15/java-dsl-for-spring-integration-1-2-milestone-2-is-available
软件详情:https://github.com/spring-projects/spring-integration-java-dsl/commits/v1.2.0.M2
下载地址:https://github.com/spring-projects/spring-integration-java-dsl/archive/v1.2.0.M2.zip
来自:开源中国社区

