activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Wistow <>
Subject Problem with Temporary Queues
Date Tue, 24 Apr 2007 13:23:16 GMT

I seem to have run into some problems with my code and I'm trying to 
track down if it's a regression in my code or a change in ActiveMQ that 
I didn't notice.

I'm attempting to send a message to a temporary queue and then wait for 
a reply using something like

  Destination     destination;
  QueueSession    session;
  QueueConnection connection;
  QueueSender     sender;
  ActiveMQConnectionFactory connectionFactory;

  connectionFactory  = new ActiveMQConnectionFactory(user, pwd, url);
  session            = connection.createSession(false, ack_mode);
  connection         = connectionFactory.createQueueConnection();
  destination        = session.createQueue(subject);
  publisher          = session.createSender(destination);

  Queue tmp_queue    = session.createTemporaryQueue();
  QueueReceiver tmp  = session.createReceiver(tmp_queue);

  Message message    = createNewMessage();


  Message tmp_mess     = (Message) tmp.receive(timeout);

The Queue at the other end recieves the message fine and replies using 
what appears to be the right queue ID

  Message reply            = createMessage();


  Queue       reply_queue  = (Queue) original_message.getJMSReplyTo();	
  QueueSender sender       = session.createSender(reply_queue);

However tmp.receive(timeout) never gets a message back, it only ever 
times out. Changing the methods to use Topic in place of Queue works 
absolutely fine. 

I'm pretty sure this code used work - I'm just about to start bisecting 
every change however I've also upgraded ActiveMQ from 0.99 to 4.11 so I 
wondered if that might have been the cause.

Any ideas?


View raw message