a modified version of vertx-gradle-template.
- vert.x 3
- boot class
- logback
Boot.java
reads a specified conf.json file and starts up the classes as desribed in the config. each verticle has its own configuration's within the conf.json. example:
{
"conf_source": "this is the root config file",
"vertx_options": {
"blocked_thread_check_period": 1000,
"max_event_loop_execute_time": 2000000000,
"max_worker_execute_time": 60000000000,
"quorum_size": 1,
"ha_group": "__DEFAULT__",
"ha_enabled": false,
"metrics_enabled": false
},
"services": ["com.deblox.myproject.PingVerticle"],
"com.deblox.myproject.PingVerticle": {
"config": {
"foo": "bar",
"baz": {}
},
"worker": false,
"multiThreaded": false,
"isolationGroup": null,
"ha": false,
"extraClasspath": null,
"instances": 1,
"redeploy": true,
"redeployScanPeriod": 250,
"redeployGracePeriod": 1000
}
}
to generate the idea files
./gradlew idea
./gradlew test -i
the Boot.java class can be run directly and accepts -conf
argument for specifiying config json.
the gradle task shadowJar will build a executable jar.
./gradlew shadowJar
when running as a fatJar, remember to specify the alternate logging implementation.
JAVA_OPTS="-Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.SLF4JLogDelegateFactory"
java $JAVA_OPTS -jar my-module-1.0.0-final-fat.jar -cp /dir/with/logback/xml