Version 7

    Message Listeners - JCA 1.5 message driven beans

     

    Message Listeners are deployed as MDBs and linked to the ResourceAdapter that uses MessageInflow

    to provide messages to the Message Listener.

     

    ejb-jar.xml

     

    <message-driven>
       <display-name>MessageBean</display-name>
       <ejb-name>MessageEJB</ejb-name>
       <ejb-class>mdb.MessageBean</ejb-class>
       <messaging-type>javax.jms.MessageListener</messaging-type>
       <transaction-type>Container</transaction-type>
       <message-destination-type>javax.jms.Queue</message-destination-type>
       <message-destination-link>LogicalQueue</message-destination-link>
       <activation-config>
          <activation-config-property>
             <activation-config-property-name>destinationType</activation-config-property-name>
             <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
          </activation-config-property>
         <activation-config-property>
             <activation-config-property-name>destination</activation-config-property-name>
             <activation-config-property-value>queue/testQueue</activation-config-property-value>
          </activation-config-property>
       </activation-config>
    </message-driven> 
    

     

    The key elements are:

     

    • messaging-type - identifies the <message-listener> from the ra.xml

    • activiation-config - used to construct an ActivationSpec that is passed to the ResourceAdapter to activate delivery

     

    jboss.xml

    <message-driven>
       <ejb-name>MessageEJB</ejb-name>
       <resource-adapter-name>jms-ra.rar</resource-adapter-name>
    </message-driven> 
    

     

    • activiation-config - used to construct an ActivationSpec that is passed to the ResourceAdapter to activate delivery

    • resource-adapter-name - identifies the RAR deployment containing the MessageListener definition

     

    Activation Config Properties

     

    Activation config properties are located in the following order:

    1. the message-driven element in jboss.xml

    2. the message-driven element ejb-jar.xml

    3. the invoker-proxy-binding/proxy-factory-config element in either jboss.xml or standardjboss.xml

     

    Related: