Interface MongodbConfig


@ConfigMapping(prefix="quarkus.mongodb") @ConfigRoot(phase=RUN_TIME) public interface MongodbConfig
  • Field Details

  • Method Details

    • defaultMongoClientConfig

      @WithParentName MongoClientConfig defaultMongoClientConfig()
      The default mongo client connection.
    • mongoClientConfigs

      @WithParentName Map<String,MongoClientConfig> mongoClientConfigs()
      Configures additional mongo client connections.

      each cluster have a unique identifier witch must be identified to select the right connection. example:

       quarkus.mongodb.cluster1.connection-string = mongodb://mongo1:27017
       quarkus.mongodb.cluster2.connection-string = mongodb://mongo2:27017,mongodb://mongo3:27017
       

      And then use annotations above the instances of MongoClient to indicate which instance we are going to use

       
       &#64;MongoClientName("cluster1")
       &#64;Inject
       ReactiveMongoClient mongoClientCluster1
       
       
    • useVertxDnsResolverInNativeMode

      @Deprecated @WithName("native.dns.use-vertx-dns-resolver") @WithDefault("false") boolean useVertxDnsResolverInNativeMode()
      Deprecated.
      This resolver is always used
      The default DNS resolver used to handle mongo+srv:// urls cannot be used in a native executable. This option enables a fallback to use Vert.x to resolve the server names instead of JNDI. IMPORTANT: The resolution may be different in JVM mode using the default (JNDI-based) DNS resolver, and in native mode. This feature is experimental.
    • dnsServerInNativeMode

      @Deprecated @WithName("native.dns.server-host") Optional<String> dnsServerInNativeMode()
      Deprecated.
      this property has been deprecated in favor of dnsServer()
      If native.dns.use-vertx-dns-resolver is set to true, this property configures the DNS server. If the server is not set, it tries to read the first nameserver from /etc/resolv.conf (if the file exists), otherwise fallback to the default.
    • dnsServer

      @WithName("dns.server-host") Optional<String> dnsServer()
      This property configures the DNS server. If the server is not set, it tries to read the first nameserver from /etc /resolv.conf (if the file exists), otherwise fallback to the default.
    • dnsServerPortInNativeMode

      @Deprecated @WithName("native.dns.server-port") OptionalInt dnsServerPortInNativeMode()
      Deprecated.
      this property has been deprecated in favor of dnsServerPort()
      If native.dns.use-vertx-dns-resolver is set to true, this property configures the DNS server port.
    • dnsServerPort

      @WithName("dns.server-port") OptionalInt dnsServerPort()
      This property configures the DNS server port.
    • dnsLookupTimeoutInNativeMode

      @Deprecated @WithName("native.dns.lookup-timeout") @WithDefault("5s") Duration dnsLookupTimeoutInNativeMode()
      Deprecated.
      this property has been deprecated in favor of dnsLookupTimeout()
      If native.dns.use-vertx-dns-resolver is set to true, this property configures the DNS lookup timeout duration.
    • dnsLookupTimeout

      @WithName("dns.lookup-timeout") @WithDefault("5s") Duration dnsLookupTimeout()
      If native.dns.use-vertx-dns-resolver is set to true, this property configures the DNS lookup timeout duration.
    • dnsLookupLogActivityInNativeMode

      @Deprecated @WithDefault("false") @WithName("native.dns.log-activity") Optional<Boolean> dnsLookupLogActivityInNativeMode()
      Deprecated.
      this property has been deprecated in favor of dnsLookupLogActivity()
      If native.dns.use-vertx-dns-resolver is set to true, this property enables the logging ot the DNS lookup. It can be useful to understand why the lookup fails.
    • dnsLookupLogActivity

      @WithDefault("false") @WithName("dns.log-activity") Optional<Boolean> dnsLookupLogActivity()
      This property enables the logging ot the DNS lookup. It can be useful to understand why the lookup fails.