vert-x3 / vertx-examples

Vert.x examples
Apache License 2.0
3.55k stars 2.09k forks source link

Vert.x 5 update #460

Open vietj opened 1 month ago

vietj commented 1 month ago

Considerations:

See

Server verticle

// 4.x

public static void main(String[] args) {
  VertxApplication.main(new String[]{Server.class.getName()});
}

...

public void start() {
  ...
  server.listen().onComplete(ar -> {
    if (ar.succeeded()) {
      System.out.println("Server started");
    } else {
      System.out.println("Server listen failed " + ar.cause().getMessage());
    }
  });
}
// 5.0

public static void main(String[] args) {
  VertxApplication.main(new String[]{Server.class.getName()});
  System.out.println("Server started");
}

...

public Future<?> start() {
  ...
  return server.listen();
}

Client verticle

// 4.x

public void start() {
  ...
  return client.asyncInteraction()
    .onSuccess(response -> System.out.println("Got response"))
   .onFailure(error -> System.out.println("Failed" + error.getMessage()));
}
// 5.0

public Future<?> start() {
  ...
  return client.asyncInteraction()
    .onSuccess(response -> System.out.println("Got response"));
}
vietj commented 1 month ago

cc @tsegismont

tsegismont commented 1 month ago

client tests should get away from using a verticle, a plain main should be enough

I believe we should review all client classes and make a decision on a case-by-case basis.

vietj commented 1 month ago

@tsegismont I think we will keep with VerticleBase for clients

tsegismont commented 1 day ago
  • Per db client

What do you mean with this?

vietj commented 1 day ago
  • Per db client

What do you mean with this?

I wish we could have at least one example for each database client using test container.