Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JCA and Message Driven Beans

 
Wilson Maliackel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Paul
 
Wilson Maliackel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Thanks,
Wilson
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic