Advertisements

Posts Tagged 'Transport'

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.

Setup:

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

jmsmodule

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

jmsmodule1

  • Select all target servers and click Next.

jmsmodule2

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

jmsmodule3

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

connfactory1

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

connfactory1

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

connfactory2

  • Click New and select type of resource as Queue.

queue1

  • Click Next and give name for Queue and JNDI.

queue2

  • Click Next and proceed to create new Sub Deployment.

queue3

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

queue4

  • Select an existing target JMS server and click Finish.

queue5

  • Verify that JMS queue is created in DemoJMSModule.

queue6

Using JMS Transport at Business Service:

  • Create a XML based business service.

bs1

  • 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.

bs2

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

bs3

  • 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.

jms1

  • Click on specific message to verify.

image

Advertisements

Advertisements

Pages

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

Join 374 other followers

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

Advertisements