Question

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();
    }
}
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top