https://github.com/researchgate/archaius-consul
Consul Connector for Archaius
https://github.com/researchgate/archaius-consul
Last synced: 10 months ago
JSON representation
Consul Connector for Archaius
- Host: GitHub
- URL: https://github.com/researchgate/archaius-consul
- Owner: researchgate
- License: apache-2.0
- Created: 2015-11-30T13:25:01.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-02T11:41:29.000Z (over 9 years ago)
- Last Synced: 2025-04-23T15:52:55.965Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 27.3 KB
- Stars: 5
- Watchers: 15
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Consul configuration source for archaius
Adds a consul configuration source to archaius that uses the key value store.
[  ](https://bintray.com/researchgate/maven/archaius-consul/_latestVersion)
[](https://travis-ci.org/researchgate/archaius-consul)
[](http://www.apache.org/licenses/LICENSE-2.0)
## Basic usage
```java
String rootPath = "/myServiceConf";
ConsulConfigurationSource consulConfigurationSource = new ConsulConfigurationSource(rootPath);
DynamicConfiguration dynamicConfiguration = new DynamicConfiguration(consulConfigurationSource, new FixedDelayPollingScheduler(-1, 5000, false));
ConfigurationManager.install(dynamicConfiguration);
```
Now for example hystrix is configurable with the consul key value store. By default it connects to the default of the consul client you can find in https://github.com/Ecwid/consul-api. (Usually it is localhost:8500)
As an alternative you can set the agent host:port on the constructor and also lists as "host:port,host2:port".
## Consul is not available
If that happens the configuration will stay as it is and the configuration source will try to connect on the next interval again.
But if consul is not available on startup the configuration source doesn't set any configuration and tries to connect the next time.