Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

WebLogic JMS Integration

If you are using a WebLogic version prior to 10.3, copy the weblogic.jar file to $MULE_HOME/lib/user. For WebLogic versions 10.3 and up, you must generate a wlfullclient.jar file from your WebLogic installation as follows:

  1. Go to the server/lib directory of your WebLogic installation.

  2. Run this command to generate the client JAR:

    
                
             
    1
    
    java -jar wljarbuilder.jar
  3. Copy the generated wlfullclient.jar file to the $MULE_HOME/lib/user directory.

JNDI destinations syntax
If Mule fails to look up topics or queues in WebLogic’s JNDI, but the JNDI tree lists them as available, try replacing JNDI subcontext delimiters with dots, so tracker/topic/PriceUpdates becomes tracker.topic.PriceUpdates.

Configuration for WebLogic 8.x and Earlier


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
    xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd
      http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.0/mule-jms.xsd">

    <jms:connector name="jmsConnector"
                   jndiProviderUrl="t3://localhost:7001"
                   connectionFactoryJndiName="javax.jms.QueueConnectionFactory"
                   jndiDestinations="true"
                   forceJndiDestinations="true"
                   jndiInitialFactory="weblogic.jndi.WLInitialContextFactory"
                   specification="1.0.2b"/>

Configuration for WebLogic 9.x

For WebLogic 9.x, the configuration is almost the same. The only differences are:

  • Supported JMS specification level is 1.1 (1.0.2b should still work, however)

  • The unified JMS connection factory can be used as a result of the above. The following example demonstrates using the default factories available out of the box.


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
    xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd
      http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.0/mule-jms.xsd">

    <jms:connector name="jmsConnector"
                   jndiProviderUrl="t3://localhost:7001"
                   connectionFactoryJndiName="weblogic.jms.ConnectionFactory"
                   jndiDestinations="true"
                   forceJndiDestinations="true"
                   jndiInitialFactory="weblogic.jndi.WLInitialContextFactory"
                   specification="1.1"/>

Configuring Security

The following example shows how to configure security on WebLogic 9.x using Spring:


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
<spring:bean name="jmsProperties" class="java.util.HashMap">
  <spring:constructor-arg>
    <spring:map>
      <spring:entry key="java.naming.security.principal" value="secureUser"/>
      <spring:entry key="java.naming.security.credentials" value="password"/>
      <spring:entry key="java.naming.security.authentication" value="simple"/>
    </spring:map>
  </spring:constructor-arg>
</spring:bean>

<jms:connector ...
    jndiProviderProperties-ref="jmsProperties"
/>

If you are using the enterprise edition of Mule ESB 2.2.3 or later, and you want to override the authorization at the endpoint level, you do the following:

  • Specify a custom JMS connector that uses the com.mulesoft.mule.transport.jms.weblogic.EeWeblogicJmsConnector class

  • Create a transformer that deletes the security properties

  • Call that transformer on the endpoint where you want to override the authorization, and then specify the new properties.

For example:


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!--
 JNDI security props have to be deleted so they aren't propagated to remote destinations in the message
-->
<message-properties-transformer name="stripJndiProps">
  <delete-message-property key="java.naming.security.principal"/>
  <delete-message-property key="java.naming.security.credentials"/>
  <delete-message-property key="java.naming.security.authentication"/>
</message-properties-transformer>

<jms:object-to-jmsmessage-transformer name="obj2jms"/>
<jms:jmsmessage-to-object-transformer name="jms2obj"/>

<jms:custom-connector name="weblogicConnector"
     class="com.mulesoft.mule.transport.jms.weblogic.EeWeblogicJmsConnector"
     jndiInitialFactory="weblogic.jndi.WLInitialContextFactory"
     connectionFactoryJndiName="weblogic.jms.ConnectionFactory"
     jndiDestinations="true"
     forceJndiDestinations="true"
     specification="1.1"
     numberOfConsumers="8"
     jndiProviderProperties-ref="jmsSecure1Properties"
     disableTemporaryReplyToDestinations="true">
</jms:custom-connector>

<model name="SecureJMSTesting">
  <service name="SecureJMS">
    <inbound>
      <jms:inbound-endpoint queue="jms.SecuredQueue1"
            transformer-refs="jms2obj stripJndiProps">
        <properties>
          <spring:entry key="java.naming.security.principal" value="user1"/>
          <spring:entry key="java.naming.security.credentials" value="password1"/>
          <spring:entry key="java.naming.security.authentication" value="simple"/>
        </properties>

        <jms:transaction action="BEGIN_OR_JOIN"/>
      </jms:inbound-endpoint>
</inbound>