This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Synchronous JMS for request response mechanism (online market place) with <5 secs response time

 
Madhu Maniganta
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am working on my part 2 assignment of SCEA and have a question about synchronous JMS communication BOTH WAYS between client and external system. During a single user session (say click of a button and before showing response screen) all this happen should happen within 5 secs for the client to see the response. Do you guys think this is possible?
Thanks,
Madhu.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Madhu,
Not reliably. I wouldn't wait on a queue while the user is actively waiting for a response.
 
Madhu Maniganta
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,
Thanks for the response, but my assignment clearly mentions for such requirement. I am worried.
Thanks,
Madhu.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Madhu Maniganta wrote:but my assignment clearly mentions for such requirement. I am worried.

Are you sure? It specifically said the user clicks submit, a message goes on a queue, another messages goes on a queue and then the user sees a result? That doesn't sound like a business requirement to me. A business requirement is something like "the user submits the form and receives a response with the success or failure of the external credit card system." Queues are one solution. I can think of several others.
 
Madhu Maniganta
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,
For an online shopping application scenario it says "The manufacturers can be contacted using jms", and in check availability use case "check availability of product with manufacturers before adding to cart" and so it needs to be synchronous call as per my understanding...let me know if Iam missing something here...
Thanks,
Madhu
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't think of a way of answering that doesn't involve providing too much help with the assignment. Try thinking about alternatives that involve using JMS but not having the user sitting around waiting for a response.
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JMS is for asynchronous communication generally, while your scenario requires synchronous communication: check-and-act. There is obvious conflict here, right? As a architect, what are you going to do? Tell me your choices before you make a decision.
 
rohid dev
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use JMS for synchronous messaging.
Also 5 sec response time is possible depends upon the resources used
The receive method can be used in several ways to perform a synchronous receive. If you specify no arguments or an argument of 0, the method blocks indefinitely until a message arrives:

Message m = queueReceiver.receive();

Message m = queueReceiver.receive(0);

For a simple client program, this may not matter. But if you do not want your program to consume system resources unnecessarily, use a timed synchronous receive. Do one of the following:

Call the receive method with a timeout argument greater than 0:
Message m = queueReceiver.receive(1); // 1 millisecond

For SCEA part 2 - make sure you have specified all your assumptions.

reference
http://download.oracle.com/javaee/1.3/jms/tutorial/1_3_1-fcs/doc/client.html
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rohid dev wrote:You can use JMS for synchronous messaging.
Also 5 sec response time is possible depends upon the resources used
The receive method can be used in several ways to perform a synchronous receive. If you specify no arguments or an argument of 0, the method blocks indefinitely until a message arrives:

Message m = queueReceiver.receive();

Message m = queueReceiver.receive(0);

For a simple client program, this may not matter. But if you do not want your program to consume system resources unnecessarily, use a timed synchronous receive. Do one of the following:

Call the receive method with a timeout argument greater than 0:
Message m = queueReceiver.receive(1); // 1 millisecond

For SCEA part 2 - make sure you have specified all your assumptions.

reference
http://download.oracle.com/javaee/1.3/jms/tutorial/1_3_1-fcs/doc/client.html


Basically, I think what you are describing is one of the asynchronous scenario. You sent msg using slsb, receiving it through MDB.
 
rohid dev
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The application after sending out order information to a Queue for further processing will then use

QueueReceiver object to receive OrderConfirmation information from another queue

 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
True. You can use JMS this way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic