【发布时间】:2014-04-21 16:40:45
【问题描述】:
我正在尝试使用轮询消费者创建一个持久订阅者。 URI 是正确的,因为在骆驼路线中使用相同的 uri 并且正确创建了持久订阅者时正在工作。 由于某种原因,PollingConsumer 无法创建持久订阅者,而是创建普通订阅者。
难道不能使用轮询消费者来创建持久订阅者吗?
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();
}
}
【问题讨论】:
标签: apache-camel activemq