Example usage for javax.jms Session createTemporaryQueue

List of usage examples for javax.jms Session createTemporaryQueue

Introduction

In this page you can find the example usage for javax.jms Session createTemporaryQueue.

Prototype


TemporaryQueue createTemporaryQueue() throws JMSException;

Source Link

Document

Creates a TemporaryQueue object.

Usage

From source file:ubic.gemma.job.grid.util.JMSBrokerMonitorImpl.java

private MapMessage sendTaskSubmissionQueueDiagnosticMessage() throws JMSException {
    MapMessage reply = jmsTemplate.execute(new SessionCallback<MapMessage>() {
        @Override//from w  w w .  j ava 2 s  .  c  om
        public MapMessage doInJms(Session session) throws JMSException {
            Queue replyTo = session.createTemporaryQueue();
            Message message = session.createMessage();
            message.setJMSReplyTo(replyTo);
            Queue queryQueue = session.createQueue("ActiveMQ.Statistics.Destination.tasks.submit");
            MessageProducer producer = session.createProducer(queryQueue);
            MessageConsumer consumer = session.createConsumer(replyTo);
            producer.send(message);
            return (MapMessage) consumer.receive(5000);
        }
    }, true);
    return reply;
}