0

I developed a Message Driven bean that will now be used for multiple destinations. I want to define the Target Destination not by annotation (which would force me to change the code for each new destination) but in the deployment descriptor. In Java EE 6 the dp should overwrite any annotations.

In my case i created a an ejb-jar and configured my mdb. Unfortunately now two mdbs are deployed. one with the annotated configuration and one from the ejb-jar.

I could easily remove the annotations and stick with the descriptor, but i would like to keep the annotations as "default" values.

Is there a way to reconfigure the annotations of my class?

The mdb will run inside a jboss 6.

MaDa
  • 10,511
  • 9
  • 46
  • 84
Laures
  • 5,389
  • 11
  • 50
  • 76

2 Answers2

1

What do you mean that 2 mdb's are deployed?

  1. Your xml config should override the annotations you have used in your mdb's code
  2. Message driven beans are pooled.
  3. The container can deploy as many mdb's as it needs to to service concurent requests,
  4. You can configure the pool size in a configuration xml for each mdb or, if I'm not mistaken, using the admin console of your server provider (eg. WebLogic)
Kris
  • 5,714
  • 2
  • 27
  • 47
  • My mdb class C has an Activation-config for the Queue 1. The ejb-jar contains a tag with C as the ejb-class and an Activation config for Queue 2. When i deploy my ear with my class C and the ejb-jar my jms broker tells me there are two consumers. One for Queue 1 and one for Queue 2. I only want the consumer for Queue 2. – Laures Apr 05 '11 at 13:33
0

As i understand it what i initially intended is not possible. For jboss the annotated configuration is one bean, the deployment descriptor a second bean. The descriptor will merge with certain aspects of the bean configuration if they are not present in xml, but the messagedriven annotation will stay valid.

Laures
  • 5,389
  • 11
  • 50
  • 76