MessageConsumer not consuming messages from Temporary queue
I have a client application that is deployed on JBoss 4.03-sp1.
The client application looks up the connection factory and queue from SJSAS8.1
I create a temporary queue, create a message, set the temporary queue in the jmsreplyto of the message and send it to the queue. However the message consumer doesnt retrieve the response from the temporary queue. If i use a queuebrowser i can find the message there. Any clue on what might be happening?
Code snippets:
TemporaryQueue temporaryQueue =null;
MessageProducer producer =null;
QueueReceiver consumer =null;
temporaryQueue = session.createTemporaryQueue();
TextMessage message = session.createTextMessage(object.toString());
message.setJMSReplyTo(temporaryQueue);
producer = session.createProducer(getJmsTemplate().getDefaultDestination());
producer.send(destination, message);
consumer = ((QueueSession)session).createReceiver(temporaryQueue);
response = consumer.receive(connectionTimeout);
response is null
but if i do the following i can retrieve the message:
if(response==null){
QueueBrowser queueBrowser = session.createBrowser(temporaryQueue);
boolean exists = queueBrowser.getEnumeration().hasMoreElements();
if (exists){
response = (Message) queueBrowser.getEnumeration().nextElement();
response.acknowledge();
}
queueBrowser.close();
}
First thing i thought was it was an expiration issue, but the JMSExpiration of the message is 0.
any hints on what might be the problem?

