Author |
Message
|
messg_wb |
Posted: Tue Oct 31, 2006 2:34 pm Post subject: WebServices cluster |
|
|
Acolyte
Joined: 29 Sep 2005 Posts: 51
|
I am trying to implement webservices cluster and facing problem, hope you guys have any ideas for me.
I am taking http request on server:A and directing it as MQ message to cluster queue (accessible to A and B servers), I am pulling the message from cluster queue and generating http reply. If server:A pulls the message from cluster queue, I am able to execute successfully, If server:B pulls message from cluster queue then I am unable to send the http reply. Basic problem is, client is waiting for reponse from A, whereas response is generated from B
I tried resetting HTTPReplyHeader.Host but it was of no use.
At first place, I am wondering if it is possible. If yes, any clue
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 31, 2006 2:38 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to set both ReplyToQueue and ReplyToQueueManager on the MQ message, and your server program needs to honor that.
This will ensure that the MQ reply message goes back to the same server that's waiting for it.
You can't use a cluster queue for a response queue - because you can't guarantee that it goes back to right person! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
messg_wb |
Posted: Tue Oct 31, 2006 2:48 pm Post subject: |
|
|
Acolyte
Joined: 29 Sep 2005 Posts: 51
|
Hello Jeff,
So you suggest to route the formatted http reply message to a queue (It needs to cluster queue so that message can be put from Server:B but defined only on server:A so that it can be processed from server: A only, on which client is waiting), instead of http reply node and have a flow to pick from that queue and route to http reply node
Did I get you correctly ?
Rgds |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 31, 2006 3:22 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I thought you were doing Http->Mq->server->mq->http?
Are you doing Mq->Http->server->http->mq?
Are you doing Http->Mq->Server->Http?
You probably can't do that last one. You'd have to pass the Http connection around, and that just doesn't work. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
messg_wb |
Posted: Tue Oct 31, 2006 8:11 pm Post subject: |
|
|
Acolyte
Joined: 29 Sep 2005 Posts: 51
|
My current flow is:
On Server A:
http request -> compute -> cluster queue
cluster queue - compute - http reply
On Server B:
cluster queue -> compute -> http reply
Is it possible ? My main aim was to work load balance http requests |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Oct 31, 2006 8:17 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
For that you'd need an http load balancer or a flow like:
http in -> MQ > balancing to server ->return to calling broker via MQ -> http reply
Note that the balancing server may be a broker working in a cluster...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 01, 2006 2:41 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I don't think you can send the HTTP Reply from another machine, no matter what.
HTTP is synchronous. That means that the client opens up the HTTP request and waits on the same network connection for the reply . Even with an HTTP Load balancer, the load balancer is stll going to wait for a reply from the machine that is picked.
You can't do
http request->compute ->cluster queue
cluster queue -> compute -> http reply
You *can* do
http requst->compute->cluster queue->mq get -> http reply
cluster queue -> compute -> mqreply _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
messg_wb |
Posted: Wed Nov 01, 2006 7:25 am Post subject: |
|
|
Acolyte
Joined: 29 Sep 2005 Posts: 51
|
Sorry !!, A small mistake, It is http input but not http request. Let me know, if this twist makes things different
Thanks for your input guys |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 01, 2006 7:31 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
messg_wb wrote: |
Sorry !!, A small mistake, It is http input but not http request. Let me know, if this twist makes things different |
NO.
An HTTP "communication" is a direct connection from the client to the server, and the response has to go back over the network pipe.
You can't move this.
You can't balance it the way you want to balance it.
You *must* send your HTTPReply from the same instance of the same flow that received the HTTP input. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
messg_wb |
Posted: Wed Nov 01, 2006 7:36 am Post subject: |
|
|
Acolyte
Joined: 29 Sep 2005 Posts: 51
|
Thanks for your clear insight on this Jeff, I would look into other alternatives to work load balance
Rgds |
|
Back to top |
|
 |
mgk |
Posted: Wed Nov 01, 2006 10:29 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi.
This is not quite right for the broker:
Quote: |
You *must* send your HTTPReply from the same instance of the same flow that received the HTTP input. |
The Broker uses a separate process (biphttplistener) to receive HTTP requests and send HTTP responses. Therefore you can "split" the request / reply over different flows or even different Execution Groups (processes). The only requirements to enable this are:
1: The HTTPInput node and the HTTPReply node must be in flows deployed to the same broker (you cannot make this work between different brokers as each broker has its own listener process).
2: The HTTPRequestIdentifier MUST be flowed between the HTTPInput node and the HTTPReply node. This ID is the way the broker correlates the request / replies in the Listener. This ID is placed in the LocalEnvironment by the HTTPInput node and it is up to the user to get it into the local envrionment correctly in the flow that will do the HTTPReply.
An Sample showing how to do this is shipped in the V6 samples (called Web Service Host) and this is also documented in the help.
Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 01, 2006 10:51 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I realized that about two minutes after I posted.
It's not a good week for me and details.
Regardless, you can't split HTTP handling between queue managers, which is what messg_wb is trying to do. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
messg_wb |
Posted: Wed Nov 01, 2006 11:03 am Post subject: |
|
|
Acolyte
Joined: 29 Sep 2005 Posts: 51
|
Thanks mgk.
No worries Jeff, you din't misguide me. In my current setup, I have http input and http reply in two different execution groups and it works well. My question was only to toggle brokers for same http request, which I understood is not possible. |
|
Back to top |
|
 |
|