You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/12/18 12:44:13 UTC
[camel] branch camel-2.20.x updated: CAMEL-12090: camel-kafka -
Better error if brokers not configured
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-2.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-2.20.x by this push:
new 105d981 CAMEL-12090: camel-kafka - Better error if brokers not configured
105d981 is described below
commit 105d9817c7162cfd5a425a14d57c5ab3bc1e077e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Dec 18 13:42:20 2017 +0100
CAMEL-12090: camel-kafka - Better error if brokers not configured
---
.../src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java | 3 +++
.../src/main/java/org/apache/camel/component/kafka/KafkaProducer.java | 3 +++
2 files changed, 6 insertions(+)
diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
index 48125ac..19c9884 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
@@ -73,6 +73,9 @@ public class KafkaConsumer extends DefaultConsumer {
if (brokers == null) {
brokers = endpoint.getComponent().getBrokers();
}
+ if (brokers == null) {
+ throw new IllegalArgumentException("URL to the Kafka brokers must be configured with the brokers option on either the component or endpoint.");
+ }
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, brokers);
diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
index e3b556b..fdc0da4 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
@@ -60,6 +60,9 @@ public class KafkaProducer extends DefaultAsyncProducer {
if (brokers == null) {
brokers = endpoint.getComponent().getBrokers();
}
+ if (brokers == null) {
+ throw new IllegalArgumentException("URL to the Kafka brokers must be configured with the brokers option on either the component or endpoint.");
+ }
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, brokers);
return props;
--
To stop receiving notification emails like this one, please contact
['"commits@camel.apache.org" <co...@camel.apache.org>'].