首页 文章

在运行时更新jms入站适配器目标

提问于
浏览
1

我正在创建一个简单的spring集成应用程序,它将消息发送到可配置的jms队列,并从不同的可配置jms队列接收消息 .

我能够使用“destination-expression”配置出站jms适配器队列,但由于这对入站适配器不起作用,我不确定如何执行此操作 .

1 回答

  • 0

    好吧,你有点误解了这个概念 .

    <int-jms:outbound-channel-adapter> 中,我们可以根据 requestMessage 发送到任何目的地 . 仅仅因为我们拥有对那里的控制权,而且我们不在JMS之外 .

    <int-jms:inbound-channel-adapter> 上,我们可以't change/dance with the destination because there is no incoming context from our application. This kind of adapter is the entry point to the SI application. So, if you change the destination at runtime, you' ll错过来自上一个目的地的消息 .

    虽然是,但您可以使用 JmsDestinationPollingSource.setDestination()/setDestinationName() 进行更改 . 您可以实现像 [INBOUND_CHANNEL_ADAPTER_ID].source 那样引用bean .

    您无法在JMS,BTW中收听来自一个消费者的多个目的地 . 所以,你真的被迫在你的应用程序中有几个入站适配器 .

相关问题