Tuesday, January 14, 2014

Polling the Message from WebSphere MQ using MQ Transport in OSB

Polling the Message from WebSphere MQ using MQ Transport in OSB

OSB MQ transport help us to post/receive message from the WebSphere MQ. The MQ transport can be configured to poll the queue for the new messages.


This blog explains how to configure the OSB Proxy Service to poll the Queue for new messages.

Steps to configure the OSB Proxy Service to poll the Queue for new messages

Create a OSB Project and Create a Resource of  type MQ Connection.


Provide the MQ Connection details like host name,port number,Queue Manager Name, Channel Name and also provide Connection Pool Size, Connection Timeout and Connection Max Wait. Provide the Static Service Account if User Name/Password is required to connect to MQ and leave the Connection type as default value(tcp mode). Save the connection details.



Create the Business based on the service URL that needs to be invoked after polling the message from the Queue.

Create a proxy Service with the Service Type as Messaging Service.


Select the Request Message Type as XML and Response Message Type as None.


Select the Protocol as mq and provide the Endpoint URI with the queue name and the Queue connection created in the previous step


Configure the polling interval accordingly(Seconds)


Open the Proxy service Message Flow and add a Routing node to the Business Service created in the previous step.

Testing:

Send  the XML payload to the Queue through HermesJMS or Java, this will initiate the proxy service and intern call the corresponding service with the XML payload(in my case BPEL service)


<ns1:EmployeeRequest xmlns:ns1=\"http://xmlns.oracle.com/JEJBSample/EmployeeDetailService/EmployeeDetailService\">\n" + 

      "<ns1:empNo>987654</ns1:empNo>\n" + 

      "</ns1:EmployeeRequest>

(Refer the following url to send the message from java to remote queue - https://www.albinsblog.com/2014/01/remote-java-client-to-post-message-to.html#.UtTaKvQW2So )


5 comments:

  1. A really really great and helpful post. I wanted to try this example but I dont see "MQ connection" under utility (Resource). I am using prebuilt soa vm provided by oracle and I guess osb version is 11.1.1.6.

    ReplyDelete
  2. Good Article. MQ Transport vs MQ Adapter, which one you recommend ?

    ReplyDelete
  3. In addition to this, you also need to ask the transportation services company about their mode of action in case the vehicle used for transportation malfunctions or meets with an accident in the midway.international leads

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Human-powered transport is a sustainable form of transport and has recently been enhanced by the use of machinery and modern technology - e.g. cycling, skating, rowing, skiing which are extremely useful in difficult environments.automoves

    ReplyDelete