Is there in nginx module to send(broadcast) a sing

2019-07-22 01:54发布

问题:

Is there in nginx module to broadcast a single request to multiple server?

My requirement is I need a nginx module which can send a single request to multiple servers(generally speaking broadcast the request).After it wait for the response for a certain time say 5 mili sec) and the response it get from from different server it either clubbed together and send back to the client or based on a parameter in the response(suppose price)it send the response to the client.

e.g: request(get the price) need to be send to server1,server2, server3 and server 4 at a time.

server1 response: price:$5
server2 response: price:$3
server3 does not respond back in 5 milisec
server4 response: price:$8

Nginx module either send back the server4 response back to client as it has highest price or it can send all the response to client by clubbed together and client will validate on the price.

标签: nginx