Laures
Laures

Reputation: 5489

Overwrite annotated Destination of MDB in a deployment descriptor

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.

Upvotes: 0

Views: 1023

Answers (2)

Laures
Laures

Reputation: 5489

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.

Upvotes: 0

Kris
Kris

Reputation: 5792

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)

Upvotes: 1

Related Questions