8 Understanding Resource Providers

This chapter describes how to use and configure Resource Providers for WebLogic Server 12.1.3. A resource provider defines the JNDI properties that allow the JMS RA to connect to the WebLogic JMS provider.

This chapter includes the following sections:

Basic Resource Provider Configuration

The JMS RA utilizes a resource-adapter config-property named resourceProviderDefintions to define the JNDI properties. This property is used by the JMS RA to access WebLogic JMS. You can configure multiple resource providers.

Note:

When describing resourceProviderDefinitions, you may need to use the escape character "%" because your WebLogic Server JNDI url may have commas. A comma is also used as a delimiter to separate properties.

For example: If the url is t3://host:port,host2:port2, the JMS RA would fail to parse the url because of the comma after "port".

To workaround this issue, escape the comma using "%". For example: t3://host:port%,host2,port

Use the following steps to configure a resource provider:

    1. Specify resourceProviderDefinitions as the config-property-name.

      <config-property-name>resourceProviderDefinitions</config-property-name>
      
    2. Specify java.lang.String as the config-property-type.

      <config-property-type>java.lang.String</config-property-type>
      
    3. Use the following name/value pair pattern to define specific JNDI properties for a resource provider:

      (RP_NAME: jndiEnv=property1=(value1,property2=value2,...))
      

      where:

      RP_NAME is a unique name used to define the JNDI properties of a resource provider and is used with the rpResourceLocation config-property for <connection-definition> and <adminobject> elements. See "Sending Outbound JMS Messages".

      property1=value1,property2=value2,... is a coma separated list of name/value pairs that define JNDI properties for a resource provider.

      Note:

      Each defined resource provider (RP_NAME value) must be unique within the ra.xml file.

For an example configuration, see Example Resource Provider Configuration.

Advanced Resource Provider Configuration using groupDefinitions

The JMS RA uses the groupDefinitions property to provide an advanced method for configuring resource providers. It enables you to create a compatible set of messaging objects while providing flexible address resolution of connection factories and adminobjects. groupDefinitions depends on the following components:

  • Group: A set of compatible messaging objects, such as connection factories and associated destination adminobjects.

  • Macro: A Group component that is substituted for a rpResourceLocation configuration property in connection factories and adminobjects.

Use the following steps to configure groupDefinitions:

  1. Specify groupDefinitions as the config-property-name.

    <config-property-name>groupDefinitions</config-property-name>
    
  2. Specify java.lang.String as the config-property-type.

    <config-property-type>java.lang.String</config-property-type>
    
  3. Use the following pattern to define a Group:

    <config-property-value>
       GROUP_NAME: macro
    </config-property-value
    

    where:

    GROUP_NAME is a unique name used to represent a Group configuration.

    macro is a coma separated list of name/value pairs that define a set of compatible messaging objects. The JMS RA substitutes these pairs for rpResourceLocation configuration properties in connection factories and adminobjects.

For an example configuration, see Example Resource Provider Configuration.

Example Resource Provider Configuration

The following section provides an example resource provider configuration. Two resource providers are configured: rp1and rp2. Two Groups are configured: GroupA and GroupB.

Example 8-1 Example Resource Provider Configuration


. . .
     <config-property>
        <config-property-name>resourceProviderDefinitions</config-property-name>
        <config-property-type>java.lang.String</config-property-type>
// Example Configuration for two resource providers: rp1 and rp2
        <config-property-value>
           (rp1: jndiEnv=(java.naming.factory.initial=
                    weblogic.jms.WrappedInitialContextFactory,
                    java.naming.provider.url=t3://@@@HOST@@@:7002,
                    java.naming.security.principal=wxyzUser1,
                    java.naming.security.credentials=wxyzPass1))
            (rp2: jndiEnv=(java.naming.factory.initial=
                    weblogic.jms.WrappedInitialContextFactory,
                    java.naming.provider.url=t3://anotherhost:8002,
                    java.naming.security.principal=wxyzUser1,
                    java.naming.security.credentials=wxyzPass1))
        </config-property-value>
. . .
     </config-property>
        <config-property>
        <config-property-name>groupDefinitions</config-property-name>
        <config-property-type>java.lang.String</config-property-type>
        <config-property-value>
                (GroupA:  connectorName=rp1,
                            cf=myCF,
                            xacf=myXACF,
                            topic1=myT1,
                            topic2=myT2,
                            queue1=myQ1,
                            queue2=myQ12)
                (GroupB:  connectorName=rp2,
                            cf=example/cf,
                            xacf=example/xacf,
                            queue1=queue1,
                            queue2=queue2)
        </config-property-value>
     </config-property>
. . .