activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nixen09 <>
Subject How to get the message from temporary Queue in Different session
Date Tue, 05 Nov 2013 09:09:37 GMT
i am new to jms and activemq. i produce one message to one static queue in
activemq and get reply back to temporary queue using getJMSReplyTo. the code
is following

ActiveMQConnectionFactory connectionFactory = new 

    // Create a Connection
    Connection connection = connectionFactory.createConnection();

    // Create a Session
    Session session = connection.createSession(false,

    // Create the destination (Topic or Queue)
    Destination destination = (Destination)  

    // Create a MessageConsumer from the Session to the Topic or Queue
    MessageConsumer consumer = session.createConsumer(destination);
    //consumer.setMessageListener(new StaticQueueListener());
    // Wait for a message
    Message message = (Message) consumer.receive();
    MessageConsumer consumer1 =
    consumer1.setMessageListener(new ReplyHandler()); 

My Reply Handler follows

public void onMessage(Message message) {


    catch (JMSException e) 

Now i am getting the result from temporary queue. because its in the same
session. my question is i want to get the message from temporary queue in
differesnt session using temporary queue name. if i want to get the message
from temporary queue in different client using temporary queue name how i
will do that ? .
when i try to do that in normal way it creating one queue.

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message