0% found this document useful (0 votes)
62 views5 pages

Message Facade PDF

The document discusses using a message facade design pattern to enable asynchronous communication between system components. It notes that with synchronous communication, clients must wait for responses from multiple business components, reducing performance. The message facade pattern allows clients to send messages without waiting for a response, improving performance by reducing blocking time. It works by having clients send messages to a JMS server, which delivers them asynchronously to a message driven bean (i.e. message facade) for processing, without blocking the client.

Uploaded by

Ashok Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views5 pages

Message Facade PDF

The document discusses using a message facade design pattern to enable asynchronous communication between system components. It notes that with synchronous communication, clients must wait for responses from multiple business components, reducing performance. The message facade pattern allows clients to send messages without waiting for a response, improving performance by reducing blocking time. It works by having clients send messages to a JMS server, which delivers them asynchronously to a message driven bean (i.e. message facade) for processing, without blocking the client.

Uploaded by

Ashok Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

JAVA Means DURGA SOFT

DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 1
JAVA Means DURGA SOFT

Message Facade

Problem: In session façade design pattern implementation the client application interact with
session façade synchronously and the session façade interact with other business components
synchronously. Due to this the client has to wait long time to generate next request because
session façade generates response to client only after communicating with multiple other
business components.

Session bean and entity bean methods execute synchronously that means the method
caller has to wait till a value is returned. In some situations like sending hundreds of mails or
firing a batch process or updating processes, the client does not have to bother about return
value. If you use synchronous session and entity beans in such situations, they take a long time
to process methods and clients have to wait till the method returns a value.

The following figure illustrates how session bean and entity bean methods execute
synchronously:

DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 2
JAVA Means DURGA SOFT

The client has to wait till all the eight synchronous steps complete. This synchronous execution
takes a long time and has an impact on performance when the method process is huge.

Solution: work with Message Faced design pattern which gives message based asynchronous
Communication.

To avoid blocking of a client, use asynchronous message driven beans, so that


client does not have to wait for a return value. If a client uses asynchronous messaging then the
client need not wait for a return value but can continue its flow of execution after sending the
message. The following figure illustrates how a client sends a message and how a message
facade (Message driven bean) processes messages asynchronously.

DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 3
JAVA Means DURGA SOFT

Here the client sends a message to JMS server gets acknowledgement from the JMS server
immediately in two step process and continues its flow of execution. Whereas JMS server
delivers the messages to Message driven bean (Message Facade) without blocking client's
execution and Message driven bean executes messages. You can use normal JMS consumers
instead of Message driven beans. This process improves performance by reducing the client's
blocking time considerably.

Note: Request/ Response model communication is generally Synchronous Communication


where as Message based communication is generally Asynchronous Communication.

DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 4
JAVA Means DURGA SOFT

DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 5

You might also like