Akka 在反应式卡夫卡中将新建主题添加到订阅

Akka 在反应式卡夫卡中将新建主题添加到订阅,akka,reactive-kafka,Akka,Reactive Kafka,iam在我们的play scala项目中开发了反应式卡夫卡,在该项目中,我们创建了5个主题,这些主题由消费群体订阅,效果良好,现在的问题是我创建了一个新主题,如何将此主题添加到现有消费群体中(可能吗) 我的代码是: val consumerSettings = ConsumerSettings(system, new ByteArrayDeserializer, new StringDeserializer) .withBootstrapServers(bootStrapServer

iam在我们的play scala项目中开发了反应式卡夫卡,在该项目中,我们创建了5个主题,这些主题由消费群体订阅,效果良好,现在的问题是我创建了一个新主题,如何将此主题添加到现有消费群体中(可能吗) 我的代码是:

val consumerSettings = ConsumerSettings(system, new ByteArrayDeserializer, new StringDeserializer)
      .withBootstrapServers(bootStrapServer)
      .withGroupId(groupId).withPollInterval(100 millis)

   Consumer.committableSource(consumerSettings, Subscriptions.topics(topicList))
            .groupedWithin(10, 15 seconds)
            .map({
              group =>
                var offSetBatch = CommittableOffsetBatch.empty
                val sessionList = group.toList.map { eachItem =>
                  offSetBatch = offSetBatch.updated(eachItem.committableOffset)
                  Json.parse(eachItem.record.value()).as[cityModel]
                }
                processRecords(cityList)
                offSetBatch
            }).mapAsync(1)(_.commitScaladsl())
            .toMat(Sink.ignore)(Keep.both)
            .run()

是否有任何方法可以将主题添加到消费者

在创建消费者时,我们可以将主题作为一种模式

Subscriptions.topicPattern(“*.in”)
这应该可以解决问题