Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8EFE1056F for ; Tue, 5 Nov 2013 09:10:53 +0000 (UTC) Received: (qmail 85349 invoked by uid 500); 5 Nov 2013 09:10:52 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 85291 invoked by uid 500); 5 Nov 2013 09:10:44 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 85275 invoked by uid 99); 5 Nov 2013 09:10:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Nov 2013 09:10:42 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of nixen09@gmail.com does not designate 216.139.250.139 as permitted sender) Received: from [216.139.250.139] (HELO joe.nabble.com) (216.139.250.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Nov 2013 09:10:37 +0000 Received: from [192.168.236.139] (helo=joe.nabble.com) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Vdce0-000303-2T for users@activemq.apache.org; Tue, 05 Nov 2013 01:09:52 -0800 Date: Tue, 5 Nov 2013 01:09:37 -0800 (PST) From: nixen09 To: users@activemq.apache.org Message-ID: <1383642576768-4673886.post@n4.nabble.com> Subject: How to get the message from temporary Queue in Different session MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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 ActiveMQConnectionFactory("tcp://localhost:61616"); // Create a Connection Connection connection = connectionFactory.createConnection(); connection.start(); // Create a Session Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); // Create the destination (Topic or Queue) Destination destination = (Destination) session.createQueue("PostWithParameter_Queue"); // 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 = session.createConsumer(message.getJMSReplyTo()); consumer1.setMessageListener(new ReplyHandler()); consumer.close(); session.close(); My Reply Handler follows @Override public void onMessage(Message message) { try { System.out.println(message.getStringProperty("status")); } catch (JMSException e) { e.printStackTrace(); } } 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: http://activemq.2283324.n4.nabble.com/How-to-get-the-message-from-temporary-Queue-in-Different-session-tp4673886.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.