简体   繁体   中英

How to push message to second kafka cluster topic if first cluster goes down using java

我有一个场景,我需要使用 java 将消息推送到 kafka 主题中……但条件是如果我的一个集群出现故障,则需要连接另一个 kafka 集群并推送消息。

You would need to configure two DefaultKafkaProducerFactory beans and two KafkaTemplate s.

When you get an exception, fail over to the other template.

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