Uploaded image for project: 'AMQ Streams'
  1. AMQ Streams
  2. ENTMQST-2414

Comparing String with Map in KafkaConnectApiImpl in Connect logging configuration

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.6.2.GA
    • 1.6.0.GA
    • None
    • None

      In the KafkaConnectApiImpl we seem to use equals() to compare String with Map<String, String>. That seems suspicious. We should investigate if that is correct and fix it if needed. The issue seems to be in this code segment (right now on lines 408-421):

              OrderedProperties ops = new OrderedProperties();
              ops.addStringPairs(desiredLogging);
              ops.asMap().entrySet().forEach(entry -> {
                  // set desired loggers to desired levels
                  if (entry.getKey().equals("log4j.rootLogger")) {
                      if (!entry.getValue().equals(fetchedLoggers.get("root"))) {
                          updateLoggers.put("root", entry.getValue());
                      }
                  } else if (entry.getKey().startsWith("log4j.logger.")) {
                      if (!entry.getValue().equals(fetchedLoggers.get(entry.getKey().substring("log4j.logger.".length())))) {
                          updateLoggers.put(entry.getKey().substring("log4j.logger.".length()), entry.getValue());
                      }
                  }
              });
      

      This is created by Strimzi#3978

              sknot@redhat.com Stanislav Knot (Inactive)
              scholzj JAkub Scholz
              Lukas Kral Lukas Kral
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: