apiVersion: v1
kind: ConfigMap
metadata:
  name: event-bus-3-config
data:
  config: |
    last_update_time: 1649210242
    env: test
    debug: false
    # sentry_dsn: ...
    
    default_kafka_config: # https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
      producer:
        "enable.idempotence": "true"
        "delivery.timeout.ms": "2600" # 2.6 seconds, default is "300000"
        "acks": "all"
        # "max.in.flight.requests.per.connection":  default is "1000000", after idempotence is "5"
        # "retries": default is "2147483647", after idempotence is INT32_MAX
        # "queue.buffering.max.messages": 100000
      consumer:
        "bootstrap.servers": "maggie-kafka-1:9094,maggie-kafka-2:9094,maggie-kafka-3:9094"
        "enable.auto.commit": "false"
        "auto.offset.reset": "latest"
        "max.poll.interval.ms": "50"
        # "allow.auto.create.topics": "true" -- doesn't work
    
    producers:
      p1:
        kafka_config:
          "bootstrap.servers": "maggie-kafka-1:9094,maggie-kafka-2:9094,maggie-kafka-3:9094"
      p2:
        kafka_config:
          "bootstrap.servers": "maggie-kafka-1:9094,maggie-kafka-2:9094,maggie-kafka-3:9094"
    
    http_app:
      use_producers:
        producer_ids: [p1]
      max_response_time: 6
    
    consumers:
      c1:
        kafka_topics: [ "^event-v3-.*" ]
        kafka_config:
          "group.id": "event-v3-test-group1"
          "max.poll.interval.ms": "300100"
        exclude_events: [ ^stress_test\..* ]
        use_producers:
          producer_ids: [ p1 ]
        sink:
          url: http://localhost:8081
          method: POST
          timeout: 5
      c2:
        kafka_topics: [ "event-v3-stress-test" ]
        kafka_config:
          "group.id": "event-v3-test-group2"
          "max.poll.interval.ms": "300082"
        include_events: []
        concurrent_per_partition: 1
        use_producers:
          producer_ids: [ p2 ]
        sink:
          url: http://localhost:8081/receive_events
          method: POST
          timeout: 10
          backoff_retry_max_time: 3
    
    topic_mapping:
      - topic: event-v3-stress-test
        patterns:
          - stress_test\..*
      - topic: event-v3-test-topic5
        patterns:
          - test\.event1
      - topic: event-v3-default
        patterns:
          - .*
