简体   繁体   中英

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM