Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS Listener vs receive() method + Web Service.  RSS feed

Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys,

I have implemented a web service client, which takes XML as an input and returns XML output.

I am converting that XML into fix length format to pass it to mainframe system and mainframe system will return fix length string.

I am calling mainframe system using JMS and using CorrelationID for identifying response.
I am using receive() method with correlation id as message selector and timeout of 5 seconds to get response from mainframe systems.
However the one who reviewed my code said. "Instead of using receive() method use Listener."

Now i am not able to understand how can i use Listener which works asynchronously with the web service which works synchronously.
Web service need to send response within few seconds.
How can i bind Listener's onMessage(Object object) with web service response ?

How do i design it ?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!