we develop a library with a sort of high level utils for Consul like leader election, consul watcher, datacenter reading etc. It is not open-sourced yet, but I hope it will be soon.
It turned out that we need a cluster of consul agents in integration tests for example 2 agents connected in one datacenter or even 2 datacenters. This may seem like a crazy idea, but it works just fine, because Consul starts and connect with other agent really fast.
I came up with the solution called ConsulCluster which I use like this
Hi,
we develop a library with a sort of high level utils for Consul like leader election, consul watcher, datacenter reading etc. It is not open-sourced yet, but I hope it will be soon. It turned out that we need a cluster of consul agents in integration tests for example 2 agents connected in one datacenter or even 2 datacenters. This may seem like a crazy idea, but it works just fine, because Consul starts and connect with other agent really fast.
I came up with the solution called ConsulCluster which I use like this
Then I can connect to any agent by retrieving its HTTP port
I can also register/deregister healthy/unhealthy service instances (but this probably should be done in https://github.com/pszymczyk/embedded-consul/issues/65 )
Of course I coded it for our case. I would need to think of more universal API.
Do you find this feature useful? :)