Does anyone know how to get the "ejb-name" (or other deployment descriptor information) of an MDB from within a method (i.e "onMessage()")?
Background: I have a situation where a set of MDBs need to post to a parallel set of queues. The problem is that I have no good way of determining the name of the new destination queue. All the MDBs use the same implementation class and differ only by the attributes in the deployment descriptor, so the class name doesn't distinguish them.
BTW - My current solution is to look at the Message (received in the onMessage()) and pull its name apart, but that may not work for all situations.
You can add <env-entry>s in your ejb-jar.xml: