aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Asynchronous processing design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Asynchronous processing design" Watch "Asynchronous processing design" New topic
Author

Asynchronous processing design

Sridhar Malladi
Greenhorn

Joined: Jun 30, 2011
Posts: 5

Hello!!

I have a scenario in the design stage where an MDB (message driven bean) process the messages from a queue and the JMS queues are directly exposed to the remote client. There are two queues - One where the messages are posted and the other where the messages are read from by the remote client. So The MDB reads from the first queue and posts the status results in the second queue.

Now in all this, what is the correct way to expose the queue(s) to a remote client .

1) SHould the queues be directly exposed to the remote client?. (The remote client uses the server specifc client jars and provider URL's & Initial context factory class. )
2) SHould an ejb client jar be provided to teh remote client where the session bean posts the messages to the first queue and another bean reads fromt the second queue.

Exposing a webservice is not an option at this point for me.


Thanks!
Sridhar Malladi
Greenhorn

Joined: Jun 30, 2011
Posts: 5

Anybody ?...
Sridhar Malladi
Greenhorn

Joined: Jun 30, 2011
Posts: 5


Im gonna go ahead and reply to this myself,

The main idea here is that high coupling between any two systems is not good and is better avoided , so since exposing the queues directly increases the dependency between the two systems, this is not a good design solution.
The interface contract should never change so this should be agreed upon well in advance, so exchanging an ejb jar should be a good solution provided the interface exposed is not bound to change.
The beset approach to this is via a http call wherein a servlet is exposed and since http communication is stateless and there is minimum dependency between the interfacing systems this is an optimal solution in general if viable.

ntumba lobo
Ranch Hand

Joined: Oct 21, 2008
Posts: 180
If I am getting this right your are talking about using a Messaging Endpoint, which is in itself a pattern for messaging applications.

http://www.eaipatterns.com/MessagingGateway.html

The messaging gateways dont have to be EJB-based

After the way you access the messaging gateways (HTTP or direct access) is up to you or requirements


SCJP 5 , SCWCD 5, SCEA 5
Sridhar Malladi
Greenhorn

Joined: Jun 30, 2011
Posts: 5

Thanks ....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Asynchronous processing design