Creating durable subscriber using Polling Consumer in camel

左心房为你撑大大i 提交于 2019-12-11 18:20:57

问题


I am trying to create a durable subscriber using polling consumer. The URI is correct as same uri is working when used in camel route and durable subscriber is correctly created. For some reason PollingConsumer is not able to create durable subscriber and instead creates normal subscriber.

Is it not possible to create durable subscribers using polling consumer?

public class OutQWaitingProcesser implements Processor {

    @Override
    public void process(Exchange exchange) throws Exception {
        Endpoint endpoint = exchange.getContext().getEndpoint("jms:topic:response?clientId=5&durableSubscriptionName=abcd");
        PollingConsumer consumer = endpoint.createPollingConsumer();
        consumer.start();
        Exchange exchange2 = consumer.receive();
        String body = exchange2.getIn().getBody(String.class);
        exchange.getIn().setBody(body);
        consumer.stop();
    }
}

回答1:


Camel JmsPollingConsumer is based on Spring JMSTemplate which doesn't support to set the durableSubscription option.



来源:https://stackoverflow.com/questions/23154099/creating-durable-subscriber-using-polling-consumer-in-camel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!