隐藏int-jms:发布 - 订阅 - 通道到spring-integration dsl

时间:2015-07-29 06:49:08

标签: spring-integration

我正在尝试转换

<int-jms:publish-subscribe-channel id="partsPubSubChannel" topic-name="part.topic" connection-factory="jmsConnectionFactory"/>

到spring-integration dsl,这是我到目前为止所做的。

@Autowired
@Qualifier("jmsConnectionFactory")
private ConnectionFactory jmsConnectionFactory;

@Bean
public IntegrationFlow partsPublishSubscribe() {
    return IntegrationFlows
            .from(Jms.publishSubscribeChannel(jmsConnectionFactory)).get();
}

如何设置topic-name属性?

1 个答案:

答案 0 :(得分:0)

@Bean
public IntegrationFlow pubSubFlow() {
    return IntegrationFlows.from(Jms.publishSubscribeChannel(this.jmsConnectionFactory)
                                    .destination("part.topic"))
                            .handle(...)
                             ...
                            .get();
}