Can HAProxy work asynchronously with backend servers

haproxyload balancing

I need a TCP load-balancer in front of some servers. I need it to:

  1. Receive a request from client
  2. Open a connection to one of servers (based on load balancing, being alive and so on)
  3. Send the request as an event to the server
  4. Close the connection to the server
  5. Receive an answer from a server
  6. Answer the client's request
  7. Close the connection from client

So I need to be connected to client and receive request and send answer in one connection, but on the other hand send the request to a server and receive the answer from (maybe another) server in two connections.

Can HAProxy fulfil this requirement? If yes, do you know a good guide for that? If no, is there any other load-balancer for this need?

Best Answer

Nothing that I have read about HAProxy would suggest that this is possible. It sounds like you need some kind of integration pattern (like messaging), not a load balancer.

A few good messaging tools to look into are RabbitMQ, ZeroMQ and Redis (which can do pub/sub).