可以的。

消费者:

订阅多个topic:

consumer.subscribe(Arrays.asList("my-topic1", "my-topic2"));

代码来自:https://www.orchome.com/451

生产者:

则需要些多条,producer.send会合并相同主题的消息的。

producer.send(new ProducerRecord<>("my-topic1", xx, xx));
producer.send(new ProducerRecord<>("my-topic2", xx, xx));

代码来自:https://www.orchome.com/303