You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2021/04/27 13:33:04 UTC

[camel-kafka-connector] branch main updated: Avoid using a fixed port for the REST service of Kafka Connect

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git


The following commit(s) were added to refs/heads/main by this push:
     new d51b0c4  Avoid using a fixed port for the REST service of Kafka Connect
d51b0c4 is described below

commit d51b0c415cbab7562378f9c82229335a7855e4ee
Author: Otavio Rodolfo Piske <op...@redhat.com>
AuthorDate: Mon Apr 26 15:19:57 2021 +0200

    Avoid using a fixed port for the REST service of Kafka Connect
---
 .../kafkaconnector/common/services/kafka/EmbeddedKafkaService.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafka/EmbeddedKafkaService.java b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafka/EmbeddedKafkaService.java
index 8dde2d2..e10b7be 100644
--- a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafka/EmbeddedKafkaService.java
+++ b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafka/EmbeddedKafkaService.java
@@ -23,6 +23,7 @@ import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.kafkaconnector.common.PluginPathHelper;
+import org.apache.camel.kafkaconnector.common.utils.NetworkUtils;
 import org.apache.camel.test.infra.kafka.services.KafkaService;
 import org.apache.kafka.connect.runtime.WorkerConfig;
 import org.apache.kafka.connect.util.clusters.EmbeddedConnectCluster;
@@ -51,7 +52,7 @@ public class EmbeddedKafkaService implements KafkaService {
         Map<String, String> workerProps = new HashMap<>();
         workerProps.put(WorkerConfig.OFFSET_COMMIT_INTERVAL_MS_CONFIG, String.valueOf(OFFSET_COMMIT_INTERVAL_MS));
 
-        String address = "http://localhost:9999";
+        String address = "http://localhost:" + NetworkUtils.getFreePort();
         LOG.info("Using the following address for  the listener configuration: {}", address);
         workerProps.put(WorkerConfig.LISTENERS_CONFIG, address);