diff --git a/pom.xml b/pom.xml
index 2070115..7d44534 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.uid2
uid2-optout
- 2.0.1
+ 2.0.2
uid2-optout
https://github.com/IABTechLab/uid2-optout
diff --git a/src/main/java/com/uid2/optout/vertx/OptOutServiceVerticle.java b/src/main/java/com/uid2/optout/vertx/OptOutServiceVerticle.java
index 2c6b68e..9562fb0 100644
--- a/src/main/java/com/uid2/optout/vertx/OptOutServiceVerticle.java
+++ b/src/main/java/com/uid2/optout/vertx/OptOutServiceVerticle.java
@@ -60,7 +60,10 @@ public class OptOutServiceVerticle extends AbstractVerticle {
private final boolean enableOptOutPartnerMock;
private final String internalApiKey;
- public OptOutServiceVerticle(Vertx vertx, IAuthorizableProvider clientKeyProvider, ICloudStorage cloudStorage, JsonObject jsonConfig) {
+ public OptOutServiceVerticle(Vertx vertx,
+ IAuthorizableProvider clientKeyProvider,
+ ICloudStorage cloudStorage,
+ JsonObject jsonConfig) {
this.healthComponent.setHealthStatus(false, "not started");
this.cloudStorage = cloudStorage;
@@ -98,12 +101,10 @@ public static void sendStatus(int statusCode, HttpServerResponse response) {
}
@Override
- public void start(Promise startPromise) throws Exception {
- LOGGER.info("starting OptOutService");
+ public void start(Promise startPromise) {
this.healthComponent.setHealthStatus(false, "still starting");
try {
- LOGGER.info("starting service on http.port: " + listenPort);
vertx.createHttpServer()
.requestHandler(createRouter())
.listen(listenPort, result -> handleListenResult(startPromise, result));
@@ -113,18 +114,16 @@ public void start(Promise startPromise) throws Exception {
}
startPromise.future()
- .onSuccess(v -> {
- LOGGER.info("started OptOutService");
- })
+ .onSuccess(v -> LOGGER.info("OptOutServiceVerticle started on HTTP port: {}", listenPort))
.onFailure(e -> {
- LOGGER.error("failed starting OptOutService", e);
+ LOGGER.error("OptOutServiceVerticle failed to start", e);
this.healthComponent.setHealthStatus(false, e.getMessage());
});
}
@Override
- public void stop() throws Exception {
- LOGGER.info("Shutting down OptOutService.");
+ public void stop() {
+ LOGGER.info("Shutting down OptOutServiceVerticle");
}
public void setCloudPaths(Collection paths) {
@@ -287,6 +286,7 @@ private void handleReplicate(RoutingContext routingContext) {
resp.setStatusCode(200)
.setChunked(true)
.write(timestamp);
+ resp.end();
}
}
});