Spring Integration DSL Channel Support

时间:2015-08-19 14:26:15

标签: spring-integration spring-dsl

在弹簧集成dsl的当前版本1.0.2中,我可以看到一些基本通道不存在,如ReST / HTTP,TCP / UDP,JDBC,MQTT等。

只是想知道这些协议/频道是否在路线图中,或者是故意排除它。

PS:我可能对发布的问题听起来很愚蠢但只是想知道原因。

1 个答案:

答案 0 :(得分:0)

从一方面你应该明白,解决这些问题已经足够大了。例如1.1@Bean释放的@Bean

从另一方面来说,Spring Integration Java DSL只是现有Spring Java& Sons的一个版本。注释配置,因此任何.handle()定义也都有效。

使用这些所需的协议,您可以继续将其组件配置为.from(),并从@Bean public MessageSource<Object> jdbcMessageSource() { return new JdbcPollingChannelAdapter(this.dataSource, "SELECT * FROM foo"); } @Bean public IntegrationFlow myFlow() { return IntegrationFlows.from(jdbcMessageSource()) .split(...) .transform(...) .handle(new MqttPahoMessageHandler("tcp://localhost:1883", "si-test-out")) .get(); } var PBpromise = $http.get('/pendingBills').then(function(response) { return ['id', 'path', 'reservas', 'importe', 'fecha']; // this will return a promise with the array as the resolve value }); var Rpromise = $q.resolve(); // a promise that is resolved immediately. Later you can replace it with the $http call var Ppromise = $q.resolve(); // a promise that is resolved immediately. Later you can replace it with the $http call var promise = $q.all([PBdpromise, Rpromise, Ppromise]).then(function (results){ // $q.all also returns a promise console.log('Results', results); return { // this will be the resolve value of the returned $q promise PendingBills: results[0], Remittances: results[1], Payed: results[2] }; }); EIP方法中引用它们。

例如:

$q.resolve()