首页 > 解决方案 > Spring Integration Poller 丢弃消息

问题描述

我想将从 jms 队列接收到的消息发送到 spring pub 子通道,以便将相同的消息转发到两个目的地。轮询器在直接频道上工作正常,但在发布到 pub 子频道时会丢弃消息。请让我知道我错过了什么。

<int-jms:inbound-channel-adapter connection-factory="connectionFactory" destination-name="queue-name" channel="jmsChannel" extract-payload="false" acknowledge="transacted">
        <int:poller max-messages-per-poll="5" fixed-delay="1000"></int:poller>
                </int-jms:inbound-channel-adapter>

<int:publish-subscribe-channel id="jmsChannel" task-executor="executor" />              
        
    <task:executor id="executor" pool-size="10"/>
    
<int-jms:outbound-channel-adapter  connection-factory="connectionFactory" channel="jmsChannel"  destination-name="sample-q" />

标签: spring-integration

解决方案


发布/订阅频道的默认行为类似于没有持久订阅的 JMS 主题;如果没有订阅者,则丢弃该消息。


推荐阅读