Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2525

Microprofile client queries every configuration key on invocation

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Minor
    • None
    • 4.6.0.Final
    • jaxrs
    • None

    Description

      We noticed that every time a microprofile client is invoked, it queries all config propertyNames.

      It's caused by the following method in org.jboss.resteasy.microprofile.client.RestClientDelegateBean:

      private void getConfigProperties(String property, Map<String, Integer> configProperties) {
              // TODO If the property isn't an integer it will fail!
              for (String propertyName : config.getPropertyNames()) {
                  if (propertyName.startsWith(property)) {
                      Integer value = config.getValue(propertyName, Integer.class);
                      String strippedProperty = propertyName.replace(property, "");
                      configProperties.put(strippedProperty, value);
                  }
              }
          }
      

      Calling config.getPropertyNames() on every client invocation could be quite an overhead (especially if one has multiple configSources with more resource-houngry ones amongst them (ie. ETCD, database...)).

      If its possible it would be more efficient if only the keys needed by resteasy client would be loaded.

      Attachments

        Activity

          People

            rhn-engineering-ema Jim Ma
            mpetrenyi Márk Petrényi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: