This content has been marked as final.
Show 5 replies
-
1. Re: register mdb on queue
wolfc Jul 5, 2006 10:45 AM (in response to hoeft)EJB3 Core 5.4.16.1
A JMS message-driven bean is associated with a JMS Destination (Queue or Topic) when the bean is
deployed in the container. It is the responsibility of the Deployer to associate the message-driven bean
with a Queue or Topic.
In short: no. -
2. Re: register mdb on queue
hoeft Jul 5, 2006 10:53 AM (in response to hoeft):-(((((
Thanks a lot
Meinert -
3. Re: register mdb on queue
oly Oct 5, 2006 12:50 PM (in response to hoeft)The short answer is implement the interface
javax.jms.MessageListener
and add the annotation@MessageDriven
to your class. Here's an example:@MessageDriven(activateConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/MyMDBQueue") }) // NOTE: the EJB3 JSR says this class must not be final public class MyMDB implements MessageListener { private static final Logger l = Logger.getLogger(MyMDB.class); // NOTE: the EJB specification says we must have a public constructor with no arguments public MyMDB() { // to support spec } // NOTE: the EJB specification says this method must not be final public void onMessage(final Message message) { l.debug("*********** GOT MESSAGE: " + message); } }
Thats it, the end, simple ... until you get into persistence and security a bit more. -
4. Property for setting MDB maximum pool size?
vmarco Jan 5, 2007 5:44 PM (in response to hoeft)What is the property for setting the maxium MDB pool size?
I have tried both:@ActivationConfigProperty(propertyName = "maximumSize", propertyValue = "20"),
and@ActivationConfigProperty(propertyName = "maxPoolSize", propertyValue = "20"),
but to no avail. -
5. Re: register mdb on queue
am_malu Jun 21, 2007 6:54 AM (in response to hoeft)In the annotation Oracle wants destinationName and jboss wants destination.
Can I use something which both app server would be happy with.
@MessageDriven(activationConfig={
@ActivationConfigProperty(propertyName="destination", propertyValue="queue/ServiceInvocationQueue"),
@ActivationConfigProperty(propertyName="destinationName", propertyValue="queue/ServiceInvocationQueue"),
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue")
})
Jboss throws error when I have this.