activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Creating queue and accessing them through different session
Date Wed, 23 Apr 2008 10:55:25 GMT
On 18/04/2008, gupabhi <abhi.gupta@morganstanley.com> wrote:
>
>  Hi,
>     I'm new to ActiveMQ. Here is my usecase:  I want to create a queue using
>  a non-transacted session. Put in a message in that queue.  And then access
>  the message from that queue from a different transacted session.
>
>  To put in the message I do:
>  nonTxSession = (QueueSession) queueConnection.createSession(false,
>  Session.AUTO_ACKNOWLEDGE);
>  requestQueue = session.createQueue("REQUEST");
>  requestQueueSender = nonTxSession .createSender(requestQueue);
>  Message message = getCurrentSession().createTextMessage("MyMsg");
>  qs.send( message );
>
>
>  I receive the message through Springs DefaultMessageListernerContainer, with
>  a JMSTransactionManager in it.
>  So bascially, it creates a consumer with the same name as the requestQueue
>  above ("REQUEST").
>  But the receive return with a "null".

I don't follow - there's no Message object - or the payload is empty?

What you describe should work - its normal JMS to send a message to a
queue and then consume it later on with a different session

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message