1 Reply Latest reply: Mar 21, 2012 8:06 AM by Jesper Pedersen RSS

trying to understand JBoss ra.xml required-config-property for inbound

jleinawe Newbie

My resource-adapter has 3 required-config-property elements

 

from ra.xml:

  <inbound-resourceadapter>
    <messageadapter>
       <messagelistener>
          <messagelistener-type>
             javax.jms.MessageListener
          </messagelistener-type>
          <activationspec>
             <activationspec-class>
                weblogic.jms.ra.ActivationSpecImpl
             </activationspec-class>
             <required-config-property>
                <config-property-name>ConnectionFactory</config-property-name>
             </required-config-property>
             <required-config-property>
                <config-property-name>Destination</config-property-name>
             </required-config-property>
             <required-config-property>
                <config-property-name>DestinationType</config-property-name>
             </required-config-property>

 

 

My ra implemetation supports optional config-properties, such as MessageSelector that I specify in the MDB source

 

@MessageDriven(

    name="MyMdb",

    activationConfig = {

       @ActivationConfigProperty(propertyName = "ConnectionFactory",

                                 propertyValue = "java:jboss/wljmsra/cf"),

       @ActivationConfigProperty(propertyName = "DestinationType",

                                 propertyValue = "javax.jms.Queue"),

       @ActivationConfigProperty(propertyName = "Destination",

                                 propertyValue = "java:jboss/wljmsra/queue2"),

       @ActivationConfigProperty(propertyName = "MessageSelector",

                                 propertyValue = "Recipient = 'MDB'"),

        })

 

 

When I deploy, I get this warning and my MDB's MessageSelector is ignored.

 

WARN  [org.jboss.ejb3] (MSC service thread 1-1) JBAS014105: ActivationConfigProperty MessageSelector will be ignored since it is not allowed by resource adapter: wljmsra

 

The only way I can work around this is to add MessageSelector to my ra.xml as a required-config-property.  

 

I can also add other required-config-property elements and not assign values to them in my MDB's @ActivationConfigProperty.  This seems to defeat the purpose of having to identify "required"-config-property elements for inbound in ra.xml.

 

while the app-server is not required to enforce "required-config-property", the app-server and deployment tools are allowed to do so.

 

JCA Section 12.4.2.2: "The resource adapter may also provide in its deployment descriptor, using the required-config-property element, an optional list of configuration property names required for each activation specification. This information may be used during deployment to ensure that the required configuration properties are specified."

 

So while adding all of the RA's optional activation spec properties as "required-config-property"s in ra.xml might be a work-around for vanilla JBoss, it would make the RA non-JCA-compliant and may cause failures on other app-servers or when using various deployment tools.  Even on JBoss it may cause problems if the user is using a deployment tool that enforces "required-config-property".