WARN - HiveMQ Enterprise Extension for Kafka: The configuration file is placed at the legacy location

 Problem

After upgrading to HiveMQ 4.17 there is a warning

WARN - HiveMQ Enterprise Extension for Kafka: The configuration file is placed at the legacy location '/opt/hivemq/extensions/hivemq-kafka-extension/kafka-configuration.xml'. Please move the configuration file to the new location '/opt/hivemq/extensions/hivemq-kafka-extension/conf/config.xml'. Support for the legacy location will be removed in a future release.

 Solution

Starting with HiveMQ 4.15.0, the configuration for the HiveMQ Kafka Extension is located in HIVEMQ_HOME/extensions/hivemq-kafka-extension/conf/config.xml. Support for the previous location HIVEMQ_HOME/extensions/hivemq-kafka-extension/kafka-configuration.xml will be removed in a future release.

In version HiveMQ 4.17, location HIVEMQ_HOME/extensions/hivemq-kafka-extension/kafka-configuration.xml is still supported. This is why you only see a warning in the log (WARN), rather than an error. For future versions, move the configuration from HIVEMQ_HOME/extensions/hivemq-kafka-extension/kafka-configuration.xml to HIVEMQ_HOME/extensions/hivemq-kafka-extension/conf/config.xml.

Add a Kafka extension configuration file to the HiveMQ cluster in the following way:

  1. Create a config map from the configuration file:

    kubectl create configmap 'kafka-config' --from-file='kafka-configuration.xml'
  2. Update the values.yaml file of the hivemq-operator and specify that the Kafka configuration file is taken from the config map:

    hivemq: ... extensions: - name: hivemq-kafka-extension extensionUri: preinstalled enabled: true configMap: kafka-config ...
  3. The content of the kafka-config configMap will be mounted by the HiveMQ Operator to directory /conf-override/extensions/hivemq-kafka-extension/<kafka-configuration.xml>. To copy the configuration file to the desired location, add the following initialization script:

    hivemq: ... extensions: - name: hivemq-kafka-extension extensionUri: preinstalled enabled: true configMap: kafka-config initialization: | [[ -e /conf-override/extensions/hivemq-kafka-extension/kafka-configuration.xml ]] && rm -f $(pwd)/conf/config.xml && cp -s /conf-override/extensions/hivemq-kafka-extension/kafka-configuration.xml $(pwd)/conf/config.xml

  4. Reinstall the HiveMQ Helm chart:

  5. Verify the content of the Kafka extension’s config.xml on the HiveMQ pod: