diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 1de67862d3efe..586c4da0d0dde 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -167,7 +167,7 @@ 4.29.0 2.2 6.0.0 - 4.11.1 + 5.1.3 1.11.0 0.34.1 3.26.1 diff --git a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/FindOptions.java b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/FindOptions.java index 434fdf9c819e0..46101573383db 100644 --- a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/FindOptions.java +++ b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/FindOptions.java @@ -21,7 +21,6 @@ public class FindOptions { private Bson projection; private Bson sort; private boolean noCursorTimeout; - private boolean oplogReplay; private boolean partial; private CursorType cursorType; private Collation collation; @@ -137,17 +136,6 @@ public FindOptions noCursorTimeout(boolean noCursorTimeout) { return this; } - /** - * Users should not set this under normal circumstances. - * - * @param oplogReplay if oplog replay is enabled - * @return this - */ - public FindOptions oplogReplay(boolean oplogReplay) { - this.oplogReplay = oplogReplay; - return this; - } - /** * Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error). * @@ -294,9 +282,6 @@ public FindPublisher apply(FindPublisher stream) { if (noCursorTimeout) { publisher = publisher.noCursorTimeout(true); } - if (oplogReplay) { - publisher = publisher.oplogReplay(true); - } if (partial) { publisher = publisher.partial(true); } diff --git a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/MapReduceOptions.java b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/MapReduceOptions.java index 945414d386766..dcddb049dad27 100644 --- a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/MapReduceOptions.java +++ b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/MapReduceOptions.java @@ -25,8 +25,6 @@ public class MapReduceOptions { private long maxTime; private MapReduceAction action; private String databaseName; - private boolean sharded; - private boolean nonAtomic; private boolean bypassDocumentValidation; private Collation collation; @@ -159,30 +157,6 @@ public MapReduceOptions databaseName(String databaseName) { return this; } - /** - * Sets if the output database is sharded - * - * @param sharded if the output database is sharded - * @return this - */ - public MapReduceOptions sharded(boolean sharded) { - this.sharded = sharded; - return this; - } - - /** - * Sets if the post-processing step will prevent MongoDB from locking the database. - *

- * Valid only with the {@code MapReduceAction.MERGE} or {@code MapReduceAction.REDUCE} actions. - * - * @param nonAtomic if the post-processing step will prevent MongoDB from locking the database. - * @return this - */ - public MapReduceOptions nonAtomic(boolean nonAtomic) { - this.nonAtomic = nonAtomic; - return this; - } - /** * Sets the bypass document level validation flag. * @@ -246,8 +220,6 @@ public MapReducePublisher apply(MapReducePublisher stream) { if (databaseName != null) { publisher = publisher.databaseName(databaseName); } - publisher = publisher.sharded(sharded); - publisher = publisher.nonAtomic(nonAtomic); publisher = publisher.bypassDocumentValidation(bypassDocumentValidation); if (collation != null) { publisher = publisher.collation(collation); diff --git a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/metrics/MongoMetricsConnectionPoolListener.java b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/metrics/MongoMetricsConnectionPoolListener.java index fd0375b07e112..e7fbc5eb3fcb2 100644 --- a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/metrics/MongoMetricsConnectionPoolListener.java +++ b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/metrics/MongoMetricsConnectionPoolListener.java @@ -8,13 +8,12 @@ import org.eclipse.microprofile.metrics.Tag; import com.mongodb.connection.ServerId; -import com.mongodb.event.ConnectionAddedEvent; import com.mongodb.event.ConnectionCheckedInEvent; import com.mongodb.event.ConnectionCheckedOutEvent; -import com.mongodb.event.ConnectionPoolClosedEvent; +import com.mongodb.event.ConnectionClosedEvent; +import com.mongodb.event.ConnectionCreatedEvent; +import com.mongodb.event.ConnectionPoolCreatedEvent; import com.mongodb.event.ConnectionPoolListener; -import com.mongodb.event.ConnectionPoolOpenedEvent; -import com.mongodb.event.ConnectionRemovedEvent; import io.smallrye.metrics.MetricRegistries; @@ -23,17 +22,13 @@ public class MongoMetricsConnectionPoolListener implements ConnectionPoolListene private final static String CHECKED_OUT_COUNT_NAME = "mongodb.connection-pool.checked-out-count"; @Override - public void connectionPoolOpened(ConnectionPoolOpenedEvent event) { + public void connectionPoolCreated(ConnectionPoolCreatedEvent event) { Tag[] tags = createTags(event.getServerId()); registerGauge(SIZE_NAME, "the current size of the pool, including idle and and in-use members", tags); registerGauge(CHECKED_OUT_COUNT_NAME, "the current count of connections that are currently in use", tags); } - @Override - public void connectionPoolClosed(ConnectionPoolClosedEvent event) { - } - @Override public void connectionCheckedOut(ConnectionCheckedOutEvent event) { MetricID metricID = createMetricID(CHECKED_OUT_COUNT_NAME, event.getConnectionId().getServerId()); @@ -57,7 +52,7 @@ public void connectionCheckedIn(ConnectionCheckedInEvent event) { } @Override - public void connectionAdded(ConnectionAddedEvent event) { + public void connectionCreated(ConnectionCreatedEvent event) { MetricID metricID = createMetricID(SIZE_NAME, event.getConnectionId().getServerId()); @@ -69,7 +64,7 @@ public void connectionAdded(ConnectionAddedEvent event) { } @Override - public void connectionRemoved(ConnectionRemovedEvent event) { + public void connectionClosed(ConnectionClosedEvent event) { MetricID metricID = createMetricID(SIZE_NAME, event.getConnectionId().getServerId()); diff --git a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/graal/MongoClientSubstitutions.java b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/graal/MongoClientSubstitutions.java index 8fbf6ba4e5ddd..1bdff22b51822 100644 --- a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/graal/MongoClientSubstitutions.java +++ b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/graal/MongoClientSubstitutions.java @@ -14,16 +14,17 @@ import com.mongodb.MongoCompressor; import com.mongodb.ServerAddress; import com.mongodb.UnixServerAddress; -import com.mongodb.connection.BufferProvider; import com.mongodb.connection.SocketSettings; -import com.mongodb.connection.SocketStreamFactory; import com.mongodb.connection.SslSettings; -import com.mongodb.connection.Stream; +import com.mongodb.internal.connection.BufferProvider; import com.mongodb.internal.connection.InternalStreamConnection; import com.mongodb.internal.connection.ServerAddressHelper; import com.mongodb.internal.connection.SocketStream; +import com.mongodb.internal.connection.SocketStreamFactory; +import com.mongodb.internal.connection.Stream; import com.mongodb.internal.connection.UnixSocketChannelStream; import com.mongodb.lang.Nullable; +import com.mongodb.spi.dns.InetAddressResolver; import com.oracle.svm.core.annotate.Alias; import com.oracle.svm.core.annotate.Delete; import com.oracle.svm.core.annotate.Substitute; @@ -74,25 +75,24 @@ final class UnixServerAddressSubstitution { @TargetClass(SocketStreamFactory.class) final class SocketStreamFactorySubstitution { + @Alias + private InetAddressResolver inetAddressResolver; @Alias private SocketSettings settings; @Alias private SslSettings sslSettings; @Alias - private SocketFactory socketFactory; - @Alias private BufferProvider bufferProvider; @Substitute public Stream create(final ServerAddress serverAddress) { Stream stream; - if (socketFactory != null) { - stream = new SocketStream(serverAddress, settings, sslSettings, socketFactory, bufferProvider); - } else if (sslSettings.isEnabled()) { - stream = new SocketStream(serverAddress, settings, sslSettings, getSslContext().getSocketFactory(), - bufferProvider); + if (sslSettings.isEnabled()) { + stream = new SocketStream(serverAddress, inetAddressResolver, settings, sslSettings, + getSslContext().getSocketFactory(), bufferProvider); } else { - stream = new SocketStream(serverAddress, settings, sslSettings, SocketFactory.getDefault(), bufferProvider); + stream = new SocketStream(serverAddress, inetAddressResolver, settings, sslSettings, + SocketFactory.getDefault(), bufferProvider); } return stream; }