Message Facade PDF
Message Facade PDF
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.
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.
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