Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for configurable consul API client library plugins w/ resiliency #6

Open
bitsofinfo opened this issue Feb 24, 2016 · 0 comments

Comments

@bitsofinfo
Copy link
Owner

Need to add an plugin/abstraction for what underlying consul API library we utilize.

Plugin based feature

For now create 3 interfaces for the consul APIs we currently use

CatalogAPIClient
HealthAPIClient
AgentAPIClient

The initial set of methods on each of these 3 interfaces should be compatible with the existing orbitz methods.

Create an initial orbitz consul client implementation of all 3.

<!-- Which consul API client library plugin to use -->
<property name="consul-default-client-provider">orbitz</property>

<!-- specific functional domain override -->
<property name="consul-catalog-client-provider">orbitz</property>
<property name="consul-health-client-provider">orbitz</property>
<property name="consul-agent-client-provider">orbitz</property>

Resiliancy feature

  1. Add an option that is globally obeyed to define the timeout for all API requests (both connect and socket timeouts)
<property name="consul-api-client-timeout-seconds">30</property>
  1. We need the ability to define more than one consul host/port to talk to, specifically define which consul endpoints to use for each different API we utilize, add a new configuration properties such as:
<!-- comma separated list of host:ports to use for all API clients-->
<property name="consul-hosts">localhost:port,host2:port</property>

<!-- Permit specific overrides of hosts to uses for specific APIs -->
<property name="consul-agent-hosts">localhost:port,host2:port</property>
<property name="consul-health-hosts">localhost:port,host2:port</property>
<property name="consul-catalog-hosts">localhost:port,host2:port</property>

<!-- still support this backwards compatible method, which would seed consul-hosts -->
<property name="consul-host">localhost</property>
<property name="consul-port">8500</property>

Behavior when multiple hosts are specified

Agent / Health

If more than one agent host is configured, register against each specified agent host (both register the node and a health check)

Catalog

If more than one catalog host is configured, attempt to talk to the first one, if a transient connectivity error occurs, revert to the second host and so on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant