Re: Basic doubt about JMS under MVC?
Posted By:
Martin_Kernland
Posted On:
Wednesday, April 17, 2002 04:41 AM
To use JMS or not depends on the application you want to build.
Don't forget that JMS is asynchronous. If you depend on an immediate answer,
you might want to use a synchronous RPC mechanism.
Let's say you are implementing a book order application. The user orders the book
over the web and your servlet would send this order to a JMS queue. Now you can have
multiple order processing nodes picking the orders of the JMS queue (guaranteed only
once delivery (to each node)). Naturally your servlet gives immediately an answer back
to the user, something like "Your order is being processed". When the order is processed
you could send an email to the user. In this example, everything is asynchronous, so JMS
is a perfect choice. (it even scales well!)
But there are many applications where you want to serve the result immediately to the user.
Here JMS is not always the right choice. Try to design a solid use case first and then as a
second step choose the technology.
BTW: If you have many servlets receiving on the same queue the result will only be delivered
to one servlet. You might want to use a topic (publish/subscribe) instead of the second queue
in your design and filter the incoming messages on the servlet side.
good luck!
kerny
Re: Basic doubt about JMS under MVC?
Posted By:
Andreas_Mueller
Posted On:
Tuesday, April 16, 2002 12:23 PM
Is there any reason why you don't call the session bean directly from your controller servlet?