Shopify / toxiproxy

:alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing
https://github.com/shopify/toxiproxy
MIT License
10.83k stars 449 forks source link

Is Redis Cluster/ PostGresDB Connection(based on master/slave architecture) supported for ToxiProxy ? #557

Open Anu5399 opened 9 months ago

Anu5399 commented 9 months ago

Hi All, I tried to use toxiproxy for creating a proxy which will listen to redis cluster and toxicity can be added to the proxy. So the usecase is there is an API "A" which internally connect to the redis cluster and fetches some value and return the result as the response to the API .

Also to expose the toxiproxy port, i have used haproxy which is on same server as of toxiproxy. So whatever request is coming to 5003 port , haproxy is redirecting it to the localhost:8474 in the VM.

So proxies and toxics can be created using this.

Now proxy is applied at redis level, so in the microservice in the config , in place of redis host and port, vm host and port on which proxy is listening for redis as per the proxy created earlier.

Now when i'm making an api call then the api connects to toxiproxy and i'm able to see it in the toxiproxy logs, but after that toxiproxy is not able to forward the connection menitoned in the upstream value which is the host and port for actual redis cluster. It throws error :Source terminated / use of closed network connection