gitgabrio commented on code in PR #7272:
URL: https://github.com/apache/incubator-kie/pull/7272#discussion_r4540116560
##########
kogito-quarkus/addons/persistence/kafka/runtime/src/test/java/org/kie/kogito/persistence/kafka/KafkaProcessInstancesIT.java:
##########
@@ -88,6 +93,21 @@ void start() {
factory = new KafkaProcessInstancesFactory();
factory.setKafkaConfig(singletonMap(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,
kafka.getBootstrapServers()));
factory.setStateListener(listener);
+ createTopic();
+ }
+
+ // With Kafka Streams >= 4.2 the global table fails to initialize ("no
partitions available") if its source topic
+ // does not exist yet, so create it before the topology starts.
+ private void createTopic() {
+ String topic = topicName();
+ try (Admin admin =
Admin.create(singletonMap(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,
kafka.getBootstrapServers()))) {
+ admin.createTopics(List.of(new NewTopic(topic, 1, (short)
1))).all().get();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
Review Comment:
Thanks @jaedonP
Fine for me to keep it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]