Skip to content

Commit 39ebc14

Browse files
authored
Update to Vert.x 5.0.0.CR8 (#9882)
1 parent 984876a commit 39ebc14

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

frameworks/Java/vertx/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<maven.compiler.target>17</maven.compiler.target>
1111
<!-- the main class -->
1212
<main.class>vertx.App</main.class>
13-
<vertx.version>5.0.0.CR6</vertx.version>
14-
<netty.version>4.2.0.Final</netty.version>
13+
<vertx.version>5.0.0.CR8</vertx.version>
14+
<netty.version>4.2.1.Final</netty.version>
1515
<jackson.version>2.16.1</jackson.version>
1616
</properties>
1717

frameworks/Java/vertx/src/main/java/vertx/App.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import java.util.stream.Collectors;
3737
import java.util.stream.IntStream;
3838

39-
public class App extends AbstractVerticle implements Handler<HttpServerRequest> {
39+
public class App extends VerticleBase implements Handler<HttpServerRequest> {
4040

4141
private static final int NUM_PROCESSORS = Runtime.getRuntime().availableProcessors();
4242
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(App.class);
@@ -147,7 +147,7 @@ private MultiMap jsonHeaders() {
147147
}
148148

149149
@Override
150-
public void start(Promise<Void> startPromise) throws Exception {
150+
public Future<?> start() throws Exception {
151151
int port = 8080;
152152
server = vertx
153153
.createHttpServer(new HttpServerOptions()
@@ -173,13 +173,11 @@ public void start(Promise<Void> startPromise) throws Exception {
173173
options.setPreparedStatementCacheMaxSize(1024);
174174
options.setPipeliningLimit(256); // Large pipelining means less flushing and we use a single connection anyway
175175
Future<?> clientsInit = initClients(options);
176-
clientsInit
176+
return clientsInit
177177
.transform(ar -> {
178178
databaseErr = ar.cause();
179179
return server.listen(port);
180-
})
181-
.<Void>mapEmpty()
182-
.onComplete(startPromise);
180+
});
183181
}
184182

185183
private Future<?> initClients(PgConnectOptions options) {
@@ -275,8 +273,8 @@ public void handle(HttpServerRequest request) {
275273
}
276274

277275
@Override
278-
public void stop() {
279-
if (server != null) server.close();
276+
public Future<?> stop() throws Exception {
277+
return server != null ? server.close() : super.stop();
280278
}
281279

282280
private void sendError(HttpServerRequest req, Throwable cause) {
@@ -338,7 +336,7 @@ public Queries(HttpServerRequest req) {
338336
}
339337

340338
private void handle() {
341-
client.group(c -> {
339+
client.group(/*queries, */c -> {
342340
for (int i = 0; i < queries; i++) {
343341
c.preparedQuery(SELECT_WORLD)
344342
.execute(Tuple.of(boxedRandomWorldNumber()))
@@ -385,7 +383,7 @@ public Update(HttpServerRequest request) {
385383
}
386384

387385
public void handle() {
388-
client.group(c -> {
386+
client.group(/*worldsToUpdate.length, */c -> {
389387
final PreparedQuery<RowSet<Row>> preparedQuery = c.preparedQuery(App.SELECT_WORLD);
390388
for (int i = 0; i < worldsToUpdate.length; i++) {
391389
final Integer id = boxedRandomWorldNumber();

0 commit comments

Comments
 (0)