开发者

Asynchronous Message Queue on Cluster

开发者 https://www.devze.com 2023-03-25 12:51 出处:网络
I\'ve a site which in some cases use Message Queue asynchronously. The method which sends the message returns its id. Then I make an AJAX call to get the response for the message with the saved id.

I've a site which in some cases use Message Queue asynchronously.

The method which sends the message returns its id. Then I make an AJAX call to get the response for the message with the saved id.

This works great, but now the site is going to be on a cluster and there starts my problem. I can't ensure that the AJAX c开发者_开发技巧all will be recieved by the same server which sent the message. Is there any known solution to this problem? Any suggestions?

Thanks, Diego


three solutions come to my mind:

  1. Make client aware of server
  2. Dispatch the request on server based on client input
  3. Dispatch the request on server by remembering which request was processed earlier by which server

Sometime ago I developed a web application like this and I dispatched the request based on client input parameter, that's a better solution I think.


Clusters typically have one name and IP address combination, even though there is more than one node that makes up the cluster. If you use the clustered application's IP name or address, you should be directed to the active node of the cluster.

0

精彩评论

暂无评论...
验证码 换一张
取 消