Repository: storm
Updated Branches:
  refs/heads/master dd3dacbbe -> 39a24bd00


STORM-2003 : Make sure config contains TOPIC before get it


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/0f8aebdb
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/0f8aebdb
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/0f8aebdb

Branch: refs/heads/master
Commit: 0f8aebdb5a3fe2b04810b20aa01feaf5be1fdab0
Parents: 8115ef5
Author: darionyaphet <darion.yap...@gmail.com>
Authored: Mon Jul 25 22:26:35 2016 +0800
Committer: darionyaphet <darion.yap...@gmail.com>
Committed: Wed Aug 3 00:55:22 2016 +0800

----------------------------------------------------------------------
 .../src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java         | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/0f8aebdb/external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java
----------------------------------------------------------------------
diff --git 
a/external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java 
b/external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java
index 0ceac3a..31eaac5 100644
--- a/external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java
+++ b/external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java
@@ -98,7 +98,11 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
 
         //for backward compatibility.
         if(topicSelector == null) {
-            this.topicSelector = new DefaultTopicSelector((String) 
stormConf.get(TOPIC));
+            if(stormConf.containsKey(TOPIC)) {
+                this.topicSelector = new DefaultTopicSelector((String) 
stormConf.get(TOPIC));
+            } else {
+                throw new IllegalArgumentException("topic should be specified 
in bolt's configuration");
+            }
         }
 
         producer = new KafkaProducer<>(boltSpecfiedProperties);

Reply via email to