activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nixen09 <nixe...@gmail.com>
Subject Re: How to get the message from temporary Queue in Different session
Date Wed, 06 Nov 2013 07:32:50 GMT
Hi

Thanks for the reply.I will explain my workflow

       request (publishing)       Consuming
*client*------------------>*activemq*---------------->*service*
          <-----------------                      <-----------------
          Reply                                      Reply back to temp
queue

In Client when i create a consumer for temporary queue the consumer give a
point to temporary queue that was created in the session.it will be a
synchronize process.after that it will produce the message to
broker(activemq). Then service consume the message and reply back to temporary
queue .  i read many article about temporary queue ,all are specifying the
consumer will be in the same session or connection.
when i push one message to activemq , i can see the temporary queue in
activemq . when service consume the message , the temporary queue
 disappearing but i got result when consumer on the same session or
connection. when i tried to get the message using temporary queue name ,its
creating new queue because the temporary queue  is not there. so how can i
increase the life span of temporary queue ?
i think u got my point.if any query please feel free to reply back. Thanks
Advance

Regards
Nixon



On Tue, Nov 5, 2013 at 7:46 PM, ceposta [via ActiveMQ] <
ml-node+s2283324n4673900h96@n4.nabble.com> wrote:

> You should always use the name provided by JMSReplyTo header. It
> shouldn't make a difference which session you're using. Temporary
> destination lifecycle (creation, and removal) are tied to the
> connection that created it, so you'd have to verify the connection is
> still around when you're using the temporary destination.
>
> On Tue, Nov 5, 2013 at 2:09 AM, nixen09 <[hidden email]<http://user/SendEmail.jtp?type=node&node=4673900&i=0>>
> wrote:
>
> > 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.
>
>
>
> --
> Christian Posta
> http://www.christianposta.com/blog
> twitter: @christianposta
>  http://www.christianposta.com/blog
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/How-to-get-the-message-from-temporary-Queue-in-Different-session-tp4673886p4673900.html
>  To unsubscribe from How to get the message from temporary Queue in
> Different session, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4673886&code=bml4ZW4wOUBnbWFpbC5jb218NDY3Mzg4NnwtMjQ2NDA2NDA0>
> .
> NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Regards
Nixon Antony




--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-get-the-message-from-temporary-Queue-in-Different-session-tp4673886p4673935.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message