• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using a JMS Queue with SOAP service to exchange XML messages

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a program that acts as a server which communicates with a client via SOAP xml messages. The program works synchronously and I need to make it Asynchronous.

The way it works:
The client sends the server a message and the server responds back with its own SOAP message. A full exchange between the client and server can have n number of messages going back and forth. The problem here is that the server might need to wait for the client to send a message somewhere in the middle of the message flow. Server does not know when that message might come in.

I did some research and found out about JMS Queues and how they work with messages. So basically, I want to use these queues to work like this:
- Client sends message
- Add message to a request queue
- Request queue checks to see if it has been waiting for this type of message (can be distinguished by an id that comes with the message).
- If it has, then make a response using that message to finish the message flow from before.
- If it hasn't been waiting for it, then make a new response as it is a new type of message.
- All response messages go to another queue (response queue) where they will, one by one, go back to the client.

Hopefully that made sense. My question is if using JMS Queues is a good way to achieve this? If so, what would I need to learn in order to code this? I followed the tutorial here: A Point-To-Point Example since I am using JBoss AS 5.1. I was able to get that to work so I have a very basic idea on how JMS Queues work.

Further advice and help would be greatly appreciated! Thanks in advance!
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I understand your description, you're still responding synchronously to each client request.
i.e. client makes a request, server can immediately send back a response.

The "asynchronous" bit you have defined is that the server might be waiting on the client for more information.
Does the server ever directly send a request to the client? Or does it only respond to the clients requests?

I'm not sure that message queues are your solution here.
It sounds more like the server needs to retain state - possibly you want some sort of workflow at the server end rather than a message queue?
 
Mo Lin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well the company I work for said they might need to send messages directly so be sure to implement that feature. So I will be adding that in, but right now it simply responds to the client's requests.

I thought JMS Queues retain state? At least on the JBoss server level. It looked to me that JMS Queues would help me save the messages and respond accordingly when the appropriate requests came in (even if the server has to wait) as I couldn't find another solution.

The company suggested me to use them after I told them about it as they use them in other products as them.

 
Can't .... do .... plaid .... So I did this tiny ad instead:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic