Don't make deploys to change simple settings.
Simply put your settings on a database (only supports DynamoDB for now) and get it updated every minute.
For examples on how to use, please check this Simple example application
- Add this to your pom.xml:
<dependencies>
<dependency>
<groupId>br.com.gabrielsaraiva.dynamicsettings</groupId>
<artifactId>dynamic-settings</artifactId>
<version>0.3.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com/</url>
</repository>
</repositories>
-
In DyanmoDB create a new table called
MySettings
, with index set tomodule
. -
Add an item with module value set to
Home
-
Create a class like that
public class Settings {
public static class Home {
public static final Setting<String> address = Setting.define("This is my house");
}
}
- Add this in your project startup:
DynamoDBProvider dynamodbProvider = new DynamoDBProvider("MySettings");
DynamicSettings ds = new DynamicSettings(dynamodbProvider, 5, Settings.class);
ds.start();
SettingsReader settingsReader = new SettingsReader();
System.out.println(settingsReader.get(Settings.Home.address));
- Run it. Change your settings values in DynamoDB. Get it updated in your program.
- Support basic types
- Support DynamoDB
- Support Dummy Provider for Testing
- Full test coverage
- Make it testable inside host projects
- JCenter
- Maven Central
- Support collections and maps
- Extract dependencies into separated modules
- Support for Redis
- Support MySql
- Support PostgreSql
- Support for MongoDB
Suggestions and PullRequests are wellcome.