| Author |
JMS: onMessage problem
|
jagadish r
Greenhorn
Joined: Aug 29, 2007
Posts: 7
|
|
Hi Friends, How to read all messages from MessageListenr and combined those messages in single string and to display it in response GUI as after calling following code: queueConnection = queueConnectionFactory.createQueueConnection(); queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE); queueReceiver = queueSession.createReceiver(queue); queueReceiver.setMessageListener(this); queueConnection.start(); ... ... .... public void onMessage(Message message) { try { String text = textMessage.getText(); System.out.println("\n text "+text); } catch (JMSException jmse){ jmse.printStackTrace( ); } } -Regards, jagdish
|
 |
Yohan Liyanage
Ranch Hand
Joined: Aug 17, 2007
Posts: 132
|
|
The onMessage() method of MessageListener interface is called whenever a message arrives at the queue, to which it is registered. Therefore, I don't see the meaning of "how to get all messages in the queue". It will be called whenever a message arrives to the queue automatically. Regards.
|
Yohan Liyanage
http://blog.yohanliyanage.com
|
 |
 |
|
|
subject: JMS: onMessage problem
|
|
|