Annotation Type 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:
         @Inject
         @MongoClientName("cluster1")
         MongoClient client;
     
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String value
      Specify the cluster name of the connection.
    • Element Detail

      • value

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