EyeMaze
EyeMaze

Reputation: 143

Java Message Driven Bean Override

I have an MDB that I cannot modify, it is declared with annotations, not within xml file.

Can I somehow override it's implementation, specifically onMessage behaviour?

I tried modyfing xml files to point MDB to different class or just simply extend original MDB class and override OnMessage method, but in logs I can see that it is always old MDB being registered and receivng all messages.

Upvotes: 0

Views: 221

Answers (1)

cheng
cheng

Reputation: 1138

You should be able to override bean class annotations with ejb-jar.xml descriptor. That's one of the main reasons to have xml descriptors.

To go one step further, you can even completely ignore annotations with ejb-jar.xml that sets metadata-complete=true.

Upvotes: 1

Related Questions