How to configure Java Message Driven Beans and the Websphere activation specification without hard-coded JNDI names?

We have an MDB that listens on Queue read data and sends data to another queue

@MessageDriven(
        activationConfig = { @ActivationConfigProperty(
                propertyName = "destinationType", propertyValue = "javax.jms.Queue"
        ) }, 
        mappedName = "jms/dataQ")
public class DataMDB implements MessageListener {

@Resource(name="jms/dataQueueConnectionFactory")
private ConnectionFactory connectionfactory;

@Resource(name="jms/dataDestinationQ")
private Destination destination;

...
}

and XML (ibm-ejb-jar-bnd.xml) with bean configuration

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar-bnd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://websphere.ibm.com/xml/ns/javaee"
    xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee   http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd"
    version="1.0">

<message-driven name="DataMDB">
        <jca-adapter activation-spec-binding-name="eis/dataListenerMDB"
            destination-binding-name="jms/dataQ" />
        <resource-ref name="jms/dataQueueConnectionFactory"
            binding-name="jms/dataQueueConnectionFactory" />
        <resource-env-ref name="jms/dataDestinationQ"
            binding-name="jms/dataDestinationQ" />
    </message-driven>

</ejb-jar-bnd>

and activation specification for this MDS on WebSphere

WAS Activation Specification

As I've seen examples from Google, this is a typical example of setting up MDB and WAS activation.

We have a problem here, since all the JNDI names visible here are hard-coded in the Java code anology, as well as in the ibm-ejb-jar-bnd.xml file.

So, is there a way that these JNDI names can be pulled outside the EJB project, so we could create one project for all clients, and clients can have their own standard JNDI names.

, .

. .

+4
1

, ibm-ejb-jar-bnd.xml, JNDI. ( JNDI ), .

(ibm-ejb-jar-bnd.xml) " ", .

+3

All Articles