It's not a secret anymore!
The moose likes EJB and other Java EE Technologies and the fly likes JCA and Message Driven Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JCA and Message Driven Beans" Watch "JCA and Message Driven Beans" New topic

JCA and Message Driven Beans

Wilson Maliackel

Joined: Oct 18, 2002
Posts: 4
Can anyone please explain, how can JCA and MDBs can go hand in hand?
I can use just JCA to send/receive messages.
But using JCA, I will have to write a listner to
check for messages in the queues.
Thanks in advance.
Wilson Maliackel
Paul Done

Joined: Jan 03, 2003
Posts: 22
JCA (Java Connector Architecture) and MDB (Message Driven Bean) are completely different things but they can be complementary. You use MDB to listen on a queue or a topic for messages which may be sent to the message oriented middleware by another application. This MDB can then use any of the Java or J2EE APIs (with only a few restrictions which apply to EJBs in general). These APIs could include JDBC for database access, JavaMail for sending emails, etc. Another one of the APIs that the MDB may choose to use is JCA. This is an API and connector architecture to enable J2EE application to access enterprise information and legacy systems (eg. SAP, Peoplesoft, Mainframe systems, etc). However to access a particular legacy system requires a suitable JCA connector (similar in concept to a JDBC driver) to be available for that particular system.
MDBs are often used to enable asynchronous processing. ie. A client can send some information (a message) to another system (eg. J2EE app server) via a queue or topic and continue doing its own work without having to wait for a response. The target app server's MDBs can then choose to process the message in its own time. This is also a good architecture for helping eliminate some single points of failure in your distributed system, where parts of the system may be prone to failure, reboots, etc..
The confusion you may be having is that a newer version of the JCA specification is also likely to support asynchronous processing by back end systems, but this is not part of a finalised J2EE standard yet.
Hope this helps
Wilson Maliackel

Joined: Oct 18, 2002
Posts: 4
Thanks for your reply.
My issue is in deciding whether to use a Startup Class as a listner for the Queues OR use MDB
to do the same.
One other thing is that for MDB I will need
the Queues bound to the App Server JNDI and with
my current JCA setup only the Queue Connection Factories are bound to the JNDI.
I agree. Here's the link:
subject: JCA and Message Driven Beans
It's not a secret anymore!