Design
By using message-driven beans, you get the features of a JMS
listener plus functions performed by the container. Compared to method calls
and events, MDB is a good choice for an application that:
- Requires components to communicate without knowing
about each other.
- Must function even if all components are not running
at the same time.
- Must be able to send messages and continue processing
withou waiting for a response.
In the FBS 10g, alerts can be generated by numerous application
modules, and OTN developers used MDBs to centralize the alert mechanism. By
removing the tight coupling between the execution of a trade transaction and
sending back the user response, the application can serve multiple users without
compromising response times. MDBs allow asynchronous processing and thereby
reduce the wait time for the customers.
All trade requests (both buy and sell) are sent as messages.
When a message is posted to the queue, the application invokes an MDB which
extracts the trade details and sends them to the exchange for processing. Once
the processing is done, the result is mailed to the customer. Since posting
a message is not a costly operation, the customers get split-second response
times.
|