Aug 4, 2009

Http/Https asynchronous handle implementation in WMB

Here I present simple option to work with the Http nodes in an asynchronous way.
The http/https in Websphere Message Broker handled by Http Listener process.
You may also work with IE01 support pack to implement the functionality of the WebSphere Message Broker HTTP listener in an external Servlet Container.

WMB Http/Https Handling in General:

Http Listener communicates with the broker by those three queues:



Each http request is written to the SYSTEM.BROKER.WS.INPUT queue which than picked up by message flow (correlation made by the URL written in the HTTP Input Node).
The HttpInputHeader is constructed from the http header data contained in the message.
Here is an example of the written request message by Http Listener to the SYSTEM.BROKER.WS.INPUT Queue:



After the message flow processing the reply message is written to the SYSTEM.BROKER.WS.REPLY queue by the Http Reply Node
(The correlation is done by MQ correlation, the correlation ID is written by the HttpInput Node to LocalEnvironment.Destination.HTTP.RequestIdentifier) which then picked up by the Http Listener process and return to the Http client.

You can find more details on this link.

The asynchronous Implementation:


I implement this scenario by two message flows, First flow receives the request and the second flow sends the reply. They connected by WMQ and they can be deployed to different execution groups.

First you receive the request.



Then construct the MQMD and store the RequestIdentifier in the MQMD header,MsgId.




At the end puts the message on the queue.


Get the message from queue.



Set the http reply correlation field by the MQMD MsgId and Optionally you can Remove the MQMD and the HttpInput headers.



That is all you need to do to make a synchronous façade for an asynchronous transaction in WMB.

1 comment:

Marimuthu Udhayakumar said...

Dear Alex Linder,
It was really helpful and makes knowledgeable.I have done this concept using JavaCompute Node.Thanks Alex..

Marimuthu Udayakumar