Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-1904

Fix validation of topics script to work with Quarkus applications

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      For Quarkus services, we use the clowder-quarkus-config-source dependency to inspect the clowder file and replace some configuration.

      For example, for the topics, if we configure the service as follows:

      mp.messaging.outgoing.tasks-out.topic=platform.rhsm-subscriptions.metering-tasks
      

      When there is not clowder file, the topic will be "platform.rhsm-subscriptions.metering-tasks". However, when there's a clowder file with the following content:

      {
        "webPort": 8081,
        "kafka" : {
          "brokers": [{
            "hostname": "localhost",
            "port": 9092
          }],
          "topics": [
            {
              "requestedName": "platform.rhsm-subscriptions.metering-tasks",
              "name" : "bbb"
            }
          ]
        }
      }
      

      The "clowder-quarkus-config-source" config source will detect that there is one requested name "platform.rhsm-subscriptions.metering-tasks" and will overwrite the topic to "bbb" instead.

      Nevertheless, this works fine only when using simple properties "mp.messaging.outgoing.tasks-out.topic=platform.rhsm-subscriptions.metering-tasks", not for computed properties that need to be resolved (for ex: "mp.messaging.outgoing.tasks-out.topic=${METERING_TASK_TOPIC}").

      We do need to use computed properties in the Quarkus-based swatch metrics to get rid of profiles (see related ticket SWATCH-1800), so METERING_TASK_TOPIC will be "platform.rhsm-subscriptions.metering-tasks" for "telemeter" and "platform.rhsm-subscriptions.metering-rhel-tasks" for "rhel". But when configuring the application with "mp.messaging.outgoing.tasks-out.topic=${METERING_TASK_TOPIC}", everything works fine, but the "validate-topics.py" script fails because the "clowder-quarkus-config-source" config source is not able to inspect for the value of "${METERING_TASK_TOPIC}" and resolve the topic to overwrite from the clowder file.

      Note that I submit a pull request to fix this limitation in "clowder-quarkus-config-source": https://github.com/RedHatInsights/clowder-quarkus-config-source/pull/181

      Acceptance Criteria

      • Uncomment the line "python bin/validate-topics.py" line in "pr_check.sh"
      • Remove references to Spring Boot, since we're now using both Spring Boot and Quarkus applications.
      • After SWATCH-1800 is merged, this script should validate that the Swatch Metrics (the Quarkus-based service) works ok.

              Unassigned Unassigned
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: