Message Driven Bean Configuration

Configuration of message driven beans (MDB) involved modifying the ejb-jar.xml and weblogic-ejb-jar.xml configuration files delivered with Oracle Utilities Smart Grid Gateway. It is recommended that instead of modifying these files directly you create "Customer Modification" (CM) versions of these files to make changes to these configuration files. This ensures that your modifications are not overwritten by future application patches.

The following section describes the changes required in the CM files for configuring the MDBs to read from the foreign JMS queues set up in the steps above. This requires creating the following files under $SPLEBASE/templates:

  • cm_​ejb-jar.xml.wls.jms_​1.include
  • cm_​ejb-jar.xml.wls.jms_​2.include
  • cm_​weblogic-ejb-jar.xml.jms.include.

Note: After making these changes the initialSetup script needs to be run and Oracle Utilities Smart Grid Gateway application needs to be redeployed. However the initialSetup script will overwrite the JMS configuration changes made in the steps above. So it is recommended to keep a backup of the $SPLEBASE/splapp/config.xml file before running this script.

Changes to cm_​ejb-jar.xml.wls.jms_​1.include

The following is an an example of the cm_​ejb-jar.xml.wls.jms_​1.include file:


<message-driven>
   <description>MDB for DestinationQueue-CM</description>
   <display-name>DestinationQueueWatcher-CM</display-name>
   
      <ejb-name>DestinationQueueWatch-CM</ejb-name>
  
   <ejb-class>com.splwg.ejb.mdb.MessageProcessor</ejb-class>
   <messaging-type>javax.jms.MessageListener</messaging-type>
   <transaction-type>Bean</transaction-type>
   <message-destination-type>javax.jms.Queue</message-destination-type>
</message-driven>

The values specified in the above file include the following:

  • ejb-name: This is the name of the MDB.

Changes to cm_​ejb-jar.xml.wls.jms_​2.include

The following is an example of the cm_​ejb-jar.xml.wls.jms_​2.include file:


   <assembly-descriptor>
   <security-role>
   <role-name>cisusers</role-name>
   </security-role>
   <container-transaction>
   <method>
   
      <ejb-name>DestinationQueueWatch-CM</ejb-name>

   <method-name>onMessage</method-name>
   </method>
   <trans-attribute>NotSupported</trans-attribute>
   </container-transaction>
   </assembly-descriptor>

The values specified in the above file include the following:

  • ejb-name: This is the name of the MDB

Changes to cm_​ejb-jar.xml.wls.jms_​2.include

The following is an example of the cm_​weblogic-ejb-jar.xml.jms.include file:


   <weblogic-enterprise-bean>   
   
<ejb-name>DestinationQueueWatch-CM</ejb-name>
   
   <message-driven-descriptor>   
   <pool>   
   <max-beans-in-free-pool>5</max-beans-in-free-pool>   
   <initial-beans-in-free-pool>1</initial-beans-in-free-pool>   
   </pool>   
   
<destination-jndi-name>ForeignDestinationQueue-CM</destination-jndi-name>
   
<connection-factory-jndi-name>ForeignConnectionFactory-CM</connection- factory-jndi-name>
   
   </message-driven-descriptor>   
   </weblogic-enterprise-bean>   

The values specified in the above file include the following:

  • ejb-name: This should be the name of the MDB as specified in ejb-jar.xml
  • destination-jndi-name: This should be the JNDI name of the foreign destination as provided in JMS module ' Foreign server ' Foreign destination ' Local JNDI name.
  • connection-factory-jndi-name: This should be the JNDI name of the connection factory as provided in JMS module ' Foreign server ' Remote Connection Factory ' Local JNDI name.