-
Notifications
You must be signed in to change notification settings - Fork 4
Quick Start
Everstray Jun Sinri Edogawa edited this page Oct 9, 2023
·
5 revisions
Before you start, you should understand the Vert.x architecture.
If you want a scaffold, you may use DryDock to build a project.
Use the class Keel to handle your jobs with Vert.x ecosystem, from initialization to exit.
public class Main{
public static void main(String[] args) {
// load configuration from resource file config.properties
Keel.getConfiguration().loadPropertiesFile("config.properties");
// initialize Keel embedded Vertx
Keel.initializeVertx(new VertxOptions())
.onSuccess(initialized->{
service()
.eventually(end->{
return Keel.gracefullyClose(promise->{
// TODO stop any running tasks before complete promise.
});
});
})
.onFailure(throwable -> {
// require an instant logger to output logs
KeelOutputEventLogCenter.instantLogger().exception(throwable, "Keel Initialize Failure");
});
}
private static Future<Void> service(){
// TODO your codes with Keel!
}
}