?
Solved

JMS: Truely asynchronize?

Posted on 2009-06-28
7
Medium Priority
?
381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 200 total points
ID: 24732459
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 400 total points
ID: 24732649
>  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 1400 total points
ID: 24732695
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JianJunShen
ID: 24733377
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 1400 total points
ID: 24733387
0
 
LVL 40

Assisted Solution

by:mrjoltcola
mrjoltcola earned 1400 total points
ID: 24733393
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 400 total points
ID: 24733399
> 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 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