kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.59k stars 1.09k forks source link

passing trigger's topic information when job execute #6256

Open inha18minseokkim opened 1 month ago

inha18minseokkim commented 1 month ago
          oh, there's closed issue that i looking for.. was this issue solved?

In my case, i created Kafka reader spring batch which is triggered by KEDA topic. and i wanted to intergrate project and looking for switch~case logic. ex) topic-1 triggers app-1 topiic-2 triggers app-2

so i thought this below works, but closed..

template:
  spec:
    containers:
      - name: containerjobname
        image: imagefoofoo
        env:
          - name: APP_NAME
            value: "{{metametadata.foo}}"

triggers:
  - metadata:
      bootstrapServers: 'kafkabroker'
      consumerGroup: topic-1-consumer-group
      lagThreshold: '1'
      offsetResetPolicy: latest
      topic: topic-1
      metametadata:
          foo : app-1
    type: kafka

Originally posted by @inha18minseokkim in https://github.com/kedacore/keda/issues/5218#issuecomment-2426597127

inha18minseokkim commented 1 month ago

i just think it would be nice for job to know which topic triggers the job in runtime, although somethings like metadata is not available. topic would be enough