activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pico Florin <>
Subject Need simple example for receiving a JMS message
Date Tue, 03 Oct 2006 08:17:08 GMT
Hi, all!
    I'm newbie in using the activemq API and I have some problems in receiving a JMS message
from a web server. Here is the scenario:
    I have a reach client who sends JMS messages to a web server (Tomcat) and it (the client)
expects a reply from the server. I have read the documentation related to this subject from
  but I'm a litlle bit confused because of this lines of code (bolded):
  //server side

public void onMessage(Message request) {      Message response = session.createMessage();
   response.setJMSCorrelationID(request.getJMSCorrelationID())      producer.send(request.getJMSReplyTo(),
response)  }
  1. In this case who is the session and how can I obtain it?  
  2. Who is the producer and how can I obtain it?
  On the client should I use the code:

// client side  Destination tempDest = session.createTemporaryQueue();  MessageConsumer responseConsumer
= session.createConsumer(tempDest);  ...    // send a request..  message.setJMSReplyTo(tempDest)
 message.setJMSCorrelationID(myCorrelationID);    producer.send(message);
  in order to receive the message?
  Thank you,

Yahoo! Messenger  NEW - crystal clear PC to PC calling worldwide with voicemail 
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message