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();
    }
}
有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top