I am software programmer and I have recently been assigned the role of creating the architecture and design for an application which would be used as an subsystem in the clients IT environment. Client wants us to use Websphere MQ and EJB 3.0 as the technology platform. However, he wants us to design the app in such a manner that its flexible and scalable. He also wants us to develop the app in line with the Domain Driven Design principles.
Let me explain you now about the business problem:
Client has a Message Broker in his IT environment which would receive XML messages from varied sources and drop it in the source_queue. Our application must read this queue and process the data. The Data flow can be depicted below as:
source_queue -> RA -> SL -> BLL(Domain Objects) -> JPA
where,
1) source_queue = the JMS queue 2) RA = Remote Adapter which would process the XML and convert it into a Java Bean to keep the other layers transparent from the underlying message element. 3) SL = Its main job is to dispatch the request to the domain obects. 4) BLL = Business Logic Layer 5) JPA = Java Persistence API to store the data to the database.
There would be a MDB which would receive the data from the queue and deliver it to the RA.
I am wondering if by making RA, SL, BLL stateless session beans, the optimal design would be achieved.
I also want to find a solution for transaction management. Again, what happens if the RA processes the XML and forwards it to SL, but there is some problem in the PA layer. This should roll back the transaction if I make use of the CMT. However, I do not want to lose the message and would prefer to save it in yet another retry queue. How is this possible???
Please help me find an optimum solution to this problem using EJB 3.0 and WS MQ.