Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Simple Question regarding JMS

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear friends,

I have a simple question regarding JMS.
I have a system where in I send a request to the server and will get a response maybe 2-3 days later.
The request is like METH_REQ with parameters A,B and C.
The response is like METH_RES with parameters D,E and F.

When I get the response I need the values of the request(A,B and C) also for reference. How can I go about this?

Thanks in advance.
 
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you have a client posting to the jms server and a MessageListener listening for messages (maybe from the same or different topic or queue)?
Are these parameters of type String - Use TextMessage
Any other java type - Use ObjectMessage

ram.
 
Rohit Ahuja
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Listening to different queue.
As for the java types, the datatypes could be interger, character etc.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How you know that it will response to you earlier message ?
Do you have some attribute say like request ID ..
if not then you can put this attribute .

You can put all three attributes response message
 
Rohit Ahuja
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Girraj,

1. I cannot use a database.
2. You saying put all three attributes in the response, means the response method will need to be altered, right ?

Thanks,
Deepak.
 
girraj meena
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Deepak ,
What format of message you are using ?
What i mean say was that if you are using Xml format then you can add three tags in your response xml.
while creating response xml just put values of three tags from request xml.
So you don't have to worry about variables.
regards
Girraj
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys, let's back off a bit and be a bit more clear about the terminology being used so that we understand exactly what the other is talking about.

There is no request/response paradigm in jms. There is no parameter either.

There is a 'jms server' which can accept messages and send them out to anyone who has registered an interest in listening to the message.
The app who puts the message is called the 'sender'.
The app who receives the messsage is called 'receiver'.
Information is contained in the message as a payload or in the header. The payload can be text, xml, Object and so on.
Headers are String properties (name -value pairs)

The messages can be Queue (Point to Point) or a Topic (One Sender, many receivers)
Finally the listener can be an ordinary java class or a MDB.

Now if we all accept that, will you please reframe the question?

ram.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic