Annotation Interface MongoClientName


@Target({TYPE,METHOD,FIELD,PARAMETER}) @Retention(RUNTIME) @Documented @Qualifier public @interface MongoClientName
Marker annotation to select mongo connection of cluster configuration Use name parameter to select it For example, if a mongo connection is configured like so in application.properties:
 quarkus.mongodb.cluster1.connection-string=mongodb://localhost:27018
 
Then to inject the proper MongoClient, you would need to use MongoClientName like so:
     &#64Inject
     &#64MongoClientName("cluster1")
     MongoClient client;
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specify the cluster name of the connection.
  • Element Details

    • value

      String value
      Specify the cluster name of the connection.
      Returns:
      the value
      Default:
      ""