Loading

How to connect to WebLogic JMS using JMS connector

Julkaisupäivä: Mar 2, 2024
Ratkaisu
Mule provides a JMS connector, which we could use to connect to WebLogic JMS destinations. 

In this example, we are going to connect to a WebLogic server 12C: 
  • WebLogic Server IP: localhost
  • WebLogic Server port: 7001
  • WebLogic Server username: weblogic
  • WebLogic Server password: welcome1
with JMS queue details below: 

  • JMS Server Name: JMSServer
  • JMS Module Name: SystemModule-0
  • JMS Queue Name: Queue-0
  • JMS Queue JNDI Name: jms/TestQueue

Configure the connector


Mule provides a JMS connector and a WebLogic JMS connector, both can be used here: 


<jms:connector name="JMS" username="weblogic" password="welcome1" validateConnections="true" jndiInitialFactory="weblogic.jndi.WLInitialContextFactory" jndiProviderUrl="t3://localhost:7001" connectionFactoryJndiName="myfactory" doc:name="JMS"/>


or 


<jms:weblogic-connector name="Web_logic_JMS" username="weblogic" password="welcome1" validateConnections="true" jndiInitialFactory="weblogic.jndi.WLInitialContextFactory" jndiProviderUrl="t3://localhost:7001" connectionFactoryJndiName="myfactory" doc:name="Web logic JMS"/>


Configure the endpoint


When configuring the JMS endpoint, we need to be careful on the name to use, because there are 2 ways to specify the name: 


1) use JNDI name


To use JNDI name, we need to add a Spring property to the connector: 


<jms:connector name="JMS" username="weblogic" password="welcome1" validateConnections="true" jndiInitialFactory="weblogic.jndi.WLInitialContextFactory" jndiProviderUrl="t3://localhost:7001" connectionFactoryJndiName="myfactory" doc:name="JMS">

        <spring:property name="jndiDestinations" value="true"/>

</jms:connector>

or:

<jms:weblogic-connector name="Web_logic_JMS" username="weblogic" password="welcome1" validateConnections="true" jndiInitialFactory="weblogic.jndi.WLInitialContextFactory" jndiProviderUrl="t3://localhost:7001" connectionFactoryJndiName="myfactory" doc:name="Web logic JMS">

        <spring:property name="jndiDestinations" value="true"/> 

    </jms:weblogic-connector>


Then we can just use the JNDI name in endpoint: 


<jms:inbound-endpoint queue="jms.TestQueue" connector-ref="Web_logic_JMS" doc:name="JMS"/>

Note: using '.' or '/' does NOT make a difference here. The following works too:


<jms:inbound-endpoint queue="jms/TestQueue" connector-ref="Web_logic_JMS" doc:name="JMS"/>


2) use complete WebLogic JMS name


By default, if nothing set, it's using name, and the format is: JMS_Server_Name/JMS_ModuleName!JMS_Queue_Name, so in this case, it's:


<jms:inbound-endpoint queue="JMSServer/SystemModule-0!Queue-0" connector-ref="Web_logic_JMS" doc:name="JMS"/>

Knowledge-artikkelin numero

001118896

 
Ladataan
Salesforce Help | Article