use of javax.jms.QueueReceiver in project zipkin by openzipkin.
the class ActiveMQSpanConsumer method registerInNewSession.
/**
* JMS contract is one session per thread: we need a new session up to our concurrency level.
*/
void registerInNewSession(ActiveMQConnection connection, String queue) throws JMSException {
// Pass redundant info as we can't use default method in activeMQ
QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
// No need to do anything on ActiveMQ side as physical queues are created on demand
Queue destination = session.createQueue(queue);
QueueReceiver receiver = session.createReceiver(destination);
receiver.setMessageListener(this);
sessionToReceiver.put(session, receiver);
}
Aggregations