Posts Tagged 'JMS'

TIBCO JMS from OSB – Issue

In the post, we have seen the required setup to be done in OSB to connect to remote TIBCO JMS queues. In OSB, we observed an issue while connecting to remote queues with the following error, though the correct username and password has been provided in foreign JMS server.

     invalid username/password.

Following are the workarounds we have done to overcome this issue:

  • Navigate to $DOMAIN_HOME/config/jms folder and open the xml file related to the JMS module. Replace the encrypted password highlighted in below screenshot with literal password text. I don’t recommend this workaround. Following it up with Oracle technical team by logging SR also would not yield any solution in the limited time we had.

                        TIBCO JMS Module

  • The issue is resolved automatically after upgrading OSB to version.

Connecting to TIBCO JMS from OSB

One of the common integration scenarios is reading or writing messages to TIBCO JMS queues. In this post, we will go through the required setup for connecting to TIBCO JMS queues from OSB.

To connect to the queues hosted in remote server, following is the common design pattern. The message will be inserted into local queues which will be pushed on to remote TIBCO JMS queue automatically by WLS.

OSB -> Foreign JMS Queue in local WLS -> Actual Remote TIBCO JMS Queue

As we know that we always use the JMS queue in the context of connection factory in OSB, we need to create the following artefacts in our OSB WLS.

  • Foreign Server
  • Connection Factory
  • Foreign JMS Queues
  • Foreign JMS Module to store above artefacts

Keep the Tibjms.jar in $DOMAIN_DIR/lib directory which contains the connection factory class that we will create as part of this setup. Depending on requirements you may want to the following other TIBCO related jars.





Setup in OSB WLS Console:

Navigate to Services -> Messaging -> JMS Modules and click on Next to create the JMS module.


Enter the JMS module name and click on Next.


Select the server to deploy the JMS module to and click on Next.



Click on Finish button and navigate to JMS module that we created by clicking on it as shown below.


We need to create the required connection factory and queues within this JMS module. The first step is creating the foreign server. So click on New button and select foreign server as shown below and click on Next button.


Enter meaningful name for foreign Server and click on Next button to proceed to next screen.


Select the Admin server or other available server to deploy this JMS server so that it can be accessible and click on Finish button.


Verify the foreign server is created and visible in Summary of Resource sections as shown below.


Click on newly created foreign JMS server to bring up the following screen. And this is the screen where we enter the remote host name and related credentials hosting the TIBCO JMS queues that we want to connect to.


Enter the values for these fields as shown below and click on Save button. And the context factory class used here is present in the Tibjms.jar that we put in the server class path.

JNDI Initial Context Factory: com.tibco.tibjms.naming.TibjmsInitialContextFactory

JNDI Connection URL : tibjmsnaming://<remote hostname>:port

                                    : ssl://<hostname>:port (if SSL enabled at remote host)

JNDI Properties Credentials : <<password to connect to remote TIBCO server>>

Confirm JNDI Properties Credentials : Re enter the password

JNDI Properties :<<username to connect remote TIBCO server>>

com.tibco.tibjms.naming.security_protocol=ssl (if ssl enabled)

com.tibco.tibjms.naming.ssl_enable_verify_host=false (if ssl enabled)

Now Click on Connection Factories tab and click on New button to create the connection factory Enter the meaningful name for the connection factory and unique local JNDI name. Remote JNDI is the JNDI of the connection factory defined in remote TIBCO server. Click on OK once all the required details have been entered.


Now Click on Destinations tab and click on New button to create the queues. Enter the meaningful name for the queue and unique local JNDI name. Remote JNDI is the JNDI of the JMS queue defined in remote TIBCO server. Click on OK once all the details have been entered. Create as many queues as required in the same way.


Now We are done with the required setup. If you have a requirement of pushing the messages TIBCO JMS then create business service with JMS transport and give the url as shown below. If you have a requirement of polling the JMS queue then create a proxy service with JMS transport and give the url as shown below.

jms:///<<JNDI of local connection Factory>>/<< JNDI of local queue>>

Using JMS transport (Contd..)

In previous post, you have seen using the JMS transport in business service to enqueue messages into JMS queue. In this post, you will use JMS Transport in proxy service to read/poll messages from JMS queue. The OSB project used for demonstration can be downloaded from this link.

Since DemoQueue has enqueued message (seen in previous post), you will read the same message using a proxy service and route it to another business service which enqueues into DemoQueue1. So create another JMS queue and required JMS resources and create new business service in similar fashion as described in previous post. Set endpoint URI to point to DemoQueue1.

Create Proxy Service and select JMS as Transport Protocol. Set endpoint URI to point to DemoQueue and Connection Factory.


Go to JMS Transport tab. Select Queue  as destination type and uncheck Is Response Required as you are not expecting response from business service.


Go to Message Flow tab. Drag Publish activity and select new business service in properties. The Publish activity is used for one-way communication and here it routes the JMS message to business service.



Deploy OSB project and observe that proxy service read the message from DemoQueue and enqueued into DemoQueue. Here your proxy service acts as a MDB that polls your JMS queue for the messages.




Using JMS transport in OSB

We use JMS queues for reliable messaging or for asynchronous communication with other legacy systems or third party systems. The JMS queues can reside in local WLS or in remote server. Here, in this post we discuss about using JMS transport in OSB and demonstrates the same using queues in local WLS. You can refer to this link for more explanation on different JMS Resources. And the OSB project used for demonstration can be downloaded from this link.

JMS queues are always referred in context of a Connection Factory, so you need to create Connection Factory first and then actual JMS queues.

In OSB, JMS transport is used to either enqueue or read messages(poll) from JMS queues. To enqueue the messages, use JMS transport in business service and to poll/read messages from JMS queue, use JMS transport in proxy service.


  • Open WLS Admin console and navigate to Home -> Messaging -> JMS Modules. Click ‘New’ to create new JMS module.


  • Enter name for this new JMS module and click ‘Next’.


  • Select all target servers and click Next.


  • Click Finish and verify new JMS module has been created successfully.


  • Now you can proceed to create Connection Factory and JMS Queue. Navigate to DemoJMSModule–> New and select Connection Factory.


  • Click Next and give name for both Connection Factory and JNDI.


  • Click Next. The target server will be selected automatically for connection factory. Click Finish.


  • Click New and select type of resource as Queue.


  • Click Next and give name for Queue and JNDI.


  • Click Next and proceed to create new Sub Deployment.


  • Provide name for this new sub deployment and click OK.


  • Select an existing target JMS server and click Finish.


  • Verify that JMS queue is created in DemoJMSModule.


Using JMS Transport at Business Service:

  • Create a XML based business service.


  • Go to Transport tab and select protocol as JMS. Observe that endpoint URI pattern:

          jms://<hostname>:<port>/<JNDI of connection factory>/<JNDI of queue>

  • If JNDI name has ‘/’, then it should be replaced with ‘.’, while specifying endpoint URI in business service.


  • Navigate to JMS Transport tab. Select Queue  as destination type, Text as message type and None as response queue.


  • Now you are done with business service. So deploy OSB project and test by giving any sample XML or text message in test console. To view messages in queue, navigate to Home->Messaging->JMS Modules-> DemoJMSModule->DemoQueue-> Monitoring. Select the queue and click on Show Messages to see all messages.


  • Click on specific message to verify.



Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 380 other subscribers

Enter your email address to follow this blog and receive notifications of new posts by email.

%d bloggers like this: