class VertxJobsService extends RestJobsService {

    @Override
    public ZonedDateTime getScheduledTime(String id) {
        CompletableFuture<Job> future = new CompletableFuture<Job>();

        client.get(JOBS_PATH + "/" + id).send(res -> {
            if (res.succeeded() && res.result().statusCode() == 200) {
                future.complete(res.result().bodyAsJson(Job.class));
            } else if (res.succeeded() && res.result().statusCode() == 404) {
                future.completeExceptionally(new JobNotFoundException(id));
            } else {
                future.completeExceptionally(new RuntimeException("Unable to find job with id " + id));
            }
        });

        try {
            return future.get().getExpirationTime();
        } catch (Exception e) {
            if (e.getCause() != null) {
                throw new RuntimeException(e.getCause());
            }
            
            throw new RuntimeException(e);
        }

    }

    @Inject public  VertxJobsService(@ConfigProperty(name = "kogito.jobs-service.url") String jobServiceUrl,
                            @ConfigProperty(name = "kogito.service.url") String callbackEndpoint,
                            Vertx vertx,
                            Instance<WebClient> providedWebClient);
      VertxJobsService();

}