aspose file tools
The moose likes EJB and Other Java EE Technologies and the fly likes can there be MDB without onMessage method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "can there be MDB without onMessage method" Watch "can there be MDB without onMessage method" New topic
Author

can there be MDB without onMessage method

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I read this from tutorial
It is recommended, but not required, that a message-driven bean class should implement the MessageListener interface for the message type it supports. This interface defines only one method onMessage( ). When the EJB container arrives a message, it calls the onMessage( ) method of the message-driven bean to process the message


then which method to call EJB container?
Krum Bakalsky
Ranch Hand

Joined: Mar 14, 2010
Posts: 46
There can be a lot of messaging systems in a JavaEE environment, JMS is just one of them.
As a messaging system, JMS defines a message listener interface, called javax.jms.MessageListener. It has only one message listener method - onMessage().
Every MDB that is based on JMS, i.e. a JMS-MDB must implement this interface and hence its single onMessage() method.

If there are other messaging systems (based on a JCA integration) supported in your JavaEE server, they can have different message listener interfaces, that can include a set of message listener methods (including more than one). So, the corresponding MDB must implement the particular message listener interface, and hence its set of message listener methods.

I am not an expert in the integration between the JMS provider and the EJB container, in most of the cases it is proprietary (because there is no spec for this).
Other messaging systems, however, are integrated with the EJB container, via Java Connector Architecture and resource adapters.

I am not a JavaEE guru, but i hoped i haven't lied to you ;) (at least not a lot...)


SCJP 6 (86% - the hard way), SCBCD 5 (81% - the hard way)
 
 
subject: can there be MDB without onMessage method
 
Threads others viewed
help need on JMS - webspher MQ in JBoss
JMS configuration question.
doubt about when an MDB redelivered happen's and not?
a mock question
MDB throw system exception
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture