简体   繁体   中英

Spring cloud Kafka Stream - Dead Letter Topic in Different Cluster

I have a Kafka consumer. If the consumer fails to read any message I need to send that to Dead Letter Topic. I am using Spring cloud Kafka stream, I enabled DLQ in configuration like this.

spring:
  cloud:
    stream:
      function:
        definition: myConsumer
      kafka:
        binder:
          consumer-properties:
            auto.offset.reset: earliest
        bindings:
           myConsumer-in-0:
            consumer:
              **enableDlq: true
              dlqName: api-consumer-count-request-DLT** ( this is in different cluster, this has its own broker list.)
      bindings:
        myConsumer-in-0:
          binder: myBinder
          destination: api-consumer
          group: count-execution
      binders:
      myBinder:
          type: kafka
          environment:
            spring:
              cloud:
                stream:
                  kafka:
                    binder:
                      brokers:{regular broker list for consumer}

But My regular Consumer topic is in a different cluster from DLQ topic. Is it possible to achieve this? If yes can you guide me through the configurations?

No; this is not currently possible; the binder will only publish to the same Kafka cluster.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM