This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes JMS: onMessage problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JMS: onMessage problem" Watch "JMS: onMessage problem" New topic

JMS: onMessage problem

jagadish r

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);

public void onMessage(Message message) {
try {
String text = textMessage.getText();
System.out.println("\n text "+text);
} catch (JMSException jmse){ jmse.printStackTrace( );

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.


Yohan Liyanage
Consider Paul's rocket mass heater.
subject: JMS: onMessage problem
Similar Threads
JMS Queue Issue
convert xml byte format message
JMS Consumer not receiving any messages.
MDB Not instantiated? Not seeing onMessage (stdout messages) - why?