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?