List of usage examples for javax.jms Message setJMSReplyTo
void setJMSReplyTo(Destination replyTo) throws JMSException;
From source file:ubic.gemma.job.grid.util.JMSBrokerMonitorImpl.java
private MapMessage sendTaskSubmissionQueueDiagnosticMessage() throws JMSException { MapMessage reply = jmsTemplate.execute(new SessionCallback<MapMessage>() { @Override//from www . ja v a 2 s.c o m 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; }