diff --git a/ivy.xml b/ivy.xml index 745fac2..9332ef0 100755 --- a/ivy.xml +++ b/ivy.xml @@ -6,9 +6,9 @@ module="opinionated-vertx"> - - - - + + + + diff --git a/src/de/pzzz/vertx/PersistentRestDataAccess.java b/src/de/pzzz/vertx/PersistentRestDataAccess.java index 02b8b11..5a9b3e4 100755 --- a/src/de/pzzz/vertx/PersistentRestDataAccess.java +++ b/src/de/pzzz/vertx/PersistentRestDataAccess.java @@ -89,10 +89,10 @@ public class PersistentRestDataAccess extends Rest private CompositeFuture readAllFiles(final List filePaths) { LOG.info("Found " + filePaths.size() + " files in directory " + baseDir); - return CompositeFuture.join(filePaths.stream().map(this::readFileContent).toList()); + return Future.join(filePaths.stream().map(this::readFileContent).toList()); } - private Future readFileContent(final String filePath) { + private Future readFileContent(final String filePath) { Promise readFuture = Promise.promise(); vertx.fileSystem().readFile(filePath) .onComplete(ar -> { diff --git a/src/de/pzzz/vertx/RestDataAccess.java b/src/de/pzzz/vertx/RestDataAccess.java index 092a2b3..fbc8cf0 100755 --- a/src/de/pzzz/vertx/RestDataAccess.java +++ b/src/de/pzzz/vertx/RestDataAccess.java @@ -68,7 +68,7 @@ public class RestDataAccess { } protected void update(final String id, final RoutingContext context) { - T newData = Json.decodeValue(context.getBody(), classReference); + T newData = context.body().asPojo(classReference); if (!newData.getId().equals(id)) { context.fail(400); } @@ -76,7 +76,7 @@ public class RestDataAccess { } protected T getDataFromRequest(final RoutingContext context) { - return Json.decodeValue(context.getBody(), classReference); + return context.body().asPojo(classReference); } private void handleMessage(final Message> request) { diff --git a/src/de/pzzz/vertx/oauth/OAuthWebClient.java b/src/de/pzzz/vertx/oauth/OAuthWebClient.java index da40f71..f25cf15 100755 --- a/src/de/pzzz/vertx/oauth/OAuthWebClient.java +++ b/src/de/pzzz/vertx/oauth/OAuthWebClient.java @@ -44,7 +44,7 @@ public class OAuthWebClient { public Future> prepareAuthenticatedRequest(final HttpMethod method, final String requestPath) { Promise> promise = Promise.promise(); - ensureIsAuthenticated().onComplete(v -> + ensureIsAuthenticated().andThen(v -> promise.complete(webClient.requestAbs(method, config.getBaseUrl() + requestPath) .bearerTokenAuthentication(token.getToken())) ).onFailure(promise::fail); diff --git a/src/de/pzzz/vertx/process/ProcessExecutionController.java b/src/de/pzzz/vertx/process/ProcessExecutionController.java index d1cdfe1..3655170 100755 --- a/src/de/pzzz/vertx/process/ProcessExecutionController.java +++ b/src/de/pzzz/vertx/process/ProcessExecutionController.java @@ -9,7 +9,6 @@ import de.pzzz.vertx.Startup; import de.pzzz.vertx.worker.DeployableWorker; import de.pzzz.vertx.worker.QueuedWorker; import io.vertx.core.Closeable; -import io.vertx.core.CompositeFuture; import io.vertx.core.Future; import io.vertx.core.Promise; @@ -28,7 +27,7 @@ public abstract class ProcessExecutionController deployWorkers() { Promise promise = Promise.promise(); - CompositeFuture.all(getWorker().stream().map(controller -> (Future) controller.deployWorkers(startup)).toList()) + Future.all(getWorker().stream().map(controller -> controller.deployWorkers(startup)).toList()) .onSuccess(res -> promise.complete()) .onFailure(error -> { LOG.log(Level.SEVERE, error.getMessage(), error); @@ -39,7 +38,7 @@ public abstract class ProcessExecutionController completion) { - CompositeFuture.all(getWorker().stream().map(worker -> (Future) worker.undeployWorkers()).toList()) + Future.all(getWorker().stream().map(DeployableWorker::undeployWorkers).toList()) .onSuccess(res -> completion.complete()) .onFailure(error -> { LOG.log(Level.SEVERE, error.getMessage(), error); diff --git a/src/de/pzzz/vertx/worker/WorkerController.java b/src/de/pzzz/vertx/worker/WorkerController.java index b6492af..3f9d989 100755 --- a/src/de/pzzz/vertx/worker/WorkerController.java +++ b/src/de/pzzz/vertx/worker/WorkerController.java @@ -8,6 +8,7 @@ import de.pzzz.vertx.Startup; import io.vertx.core.DeploymentOptions; import io.vertx.core.Future; import io.vertx.core.Promise; +import io.vertx.core.ThreadingModel; import io.vertx.core.Vertx; import io.vertx.core.eventbus.DeliveryOptions; import io.vertx.core.json.JsonObject; @@ -39,7 +40,7 @@ public abstract class WorkerController implements DeployableWorker { config.put(WORKER_BUS_ADDRESS_CONFIG, busAddress()); LOG.info("Deploy " + maxWorkers + " workers for bus " + busAddress()); DeploymentOptions workerOpts = new DeploymentOptions() - .setWorker(true) + .setThreadingModel(ThreadingModel.WORKER) .setConfig(startup.getConfig()) .setWorkerPoolName(busAddress()) .setInstances(maxWorkers)