Solved

JMS: Truely asynchronize?

Posted on 2009-06-28
7
342 Views
Last Modified: 2012-05-07
I quoted following text from website:
http://static.springframework.org/spring/docs/1.2.x/reference/jms.html#d0e13240

My questions is how to get truely asynchronize call? When receiving message, JMS seems to use one thread to keep asking whether message is arrived or not?


18.4.2. Synchronous Receiving

While JMS is typically associated with asynchronous processing, it is possible to consume messages synchronously. The overloaded receive methods provide this functionality. During a synchronous receive the calling thread blocks until a message becomes available. This can be a dangerous operation since the calling thread can potentially be blocked indefinitely. The property receiveTimeout specifies how long the receiver should wait before giving up waiting for a message.
0
Comment
Question by:JianJunShen
7 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 50 total points
Comment Utility
JMS can be completely asynchronous. The 'other end' doesn't even need to be connected all the time and you can't get more asynchronous than that
0
 
LVL 92

Assisted Solution

by:objects
objects earned 100 total points
Comment Utility
>  JMS seems to use one thread to keep asking whether message is arrived or not?

That doesn't make it synchronous, that technique wcould still process message asynchronously.
And how it handles receiving the message is dependent on the server implementation, not JMS itself.
0
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 350 total points
Comment Utility
Not disagreeing with the 2 statements above, but I think both are not addressing your specific question.

JMS is just another messaging service. In virtual all messaging services (from low level sockets to MQ Series) the differentiation from syncrhonous to asynchronous messaging model has to do with:

1) polling/looping/explicitly checking for messages (syncrhonous)
2) registering a listener and a callback mechanism (asynchonous)

We are discussing asynchronous in terms of receiving the message, not handling the message. Either model can asynchronously _handle_ the method, but that is outside the JMS model at that point.

The point to be clear on is the URL you refer to is a classic synchronous polling method, not a callback method.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:JianJunShen
Comment Utility
Refer to mrjoltcola message, where is tutorial for 2) registering a listener and a callback mechanism (asynchonous)?
0
 
LVL 40

Assisted Solution

by:mrjoltcola
mrjoltcola earned 350 total points
Comment Utility
0
 
LVL 40

Assisted Solution

by:mrjoltcola
mrjoltcola earned 350 total points
Comment Utility
I believe the book "Spring into Action" also has a good section on it, but my book is at the office so I cannot verify. I recommend buying the book if you are using Spring in your projects. It covers many useful things.

0
 
LVL 92

Assisted Solution

by:objects
objects earned 100 total points
Comment Utility
> http://static.springframework.org/spring/docs/1.2.x/reference/jms.html#d0e1324

Thats a bit out of date btw
Do you specifically need to use 1.2?
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now