You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/02/27 07:49:05 UTC

[camel-examples] 02/02: Camel-example-kafka: Fixed build

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-examples.git

commit 429ade0375bb0fc9a7857c65b19918d7fb02851e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Feb 27 08:47:04 2020 +0100

    Camel-example-kafka: Fixed build
---
 .../org/apache/camel/example/kafka/MessagePublisherClient.java     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/examples/camel-example-kafka/src/main/java/org/apache/camel/example/kafka/MessagePublisherClient.java b/examples/camel-example-kafka/src/main/java/org/apache/camel/example/kafka/MessagePublisherClient.java
index 62fcf4e..0aabc64 100644
--- a/examples/camel-example-kafka/src/main/java/org/apache/camel/example/kafka/MessagePublisherClient.java
+++ b/examples/camel-example-kafka/src/main/java/org/apache/camel/example/kafka/MessagePublisherClient.java
@@ -52,22 +52,21 @@ public final class MessagePublisherClient {
 
                 // setup kafka component with the brokers
                 ComponentsBuilderFactory.kafka()
-                        .brokers("{{kafka.host}}:{{kafka.port}}")
                         .register(camelContext, "kafka");
 
                 from("direct:kafkaStart").routeId("DirectToKafka")
-                    .to("kafka:{{producer.topic}}").log("${headers}");
+                    .to("kafka:{{producer.topic}}?brokers={{kafka.host}}:{{kafka.port}}").log("${headers}");
 
                 // Topic can be set in header as well.
 
                 from("direct:kafkaStartNoTopic").routeId("kafkaStartNoTopic")
-                    .to("kafka:dummy")
+                    .to("kafka:dummy?brokers={{kafka.host}}:{{kafka.port}}")
                     .log("${headers}");
 
                 // Use custom partitioner based on the key.
 
                 from("direct:kafkaStartWithPartitioner").routeId("kafkaStartWithPartitioner")
-                        .to("kafka:{{producer.topic}}?partitioner={{producer.partitioner}}")
+                        .to("kafka:{{producer.topic}}?partitioner={{producer.partitioner}}&brokers={{kafka.host}}:{{kafka.port}}")
                         .log("${headers}");