Repository: storm
Updated Branches:
  refs/heads/1.x-branch 36522d2f1 -> dcf1ee308


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/fb5236eb
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/fb5236eb
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/fb5236eb

Branch: refs/heads/1.x-branch
Commit: fb5236eb3cc12373f4921446a3bc7618eb832900
Parents: 36522d2
Author: darionyaphet <darion.yap...@gmail.com>
Authored: Mon Jul 25 22:26:35 2016 +0800
Committer: Jungtaek Lim <kabh...@gmail.com>
Committed: Fri Sep 23 10:20:06 2016 +0900

----------------------------------------------------------------------
 .../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/fb5236eb/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