[
https://issues.apache.org/jira/browse/STORM-2003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15404379#comment-15404379
]
ASF GitHub Bot commented on STORM-2003:
---------------------------------------
Github user darionyaphet commented on a diff in the pull request:
https://github.com/apache/storm/pull/1590#discussion_r73194225
--- Diff:
external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java ---
@@ -98,7 +98,11 @@ public void prepare(Map stormConf, TopologyContext
context, OutputCollector coll
//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 select should be
specified");
--- End diff --
@satishd nice advice and fixed
> Make sure config contains TOPIC before get it
> ---------------------------------------------
>
> Key: STORM-2003
> URL: https://issues.apache.org/jira/browse/STORM-2003
> Project: Apache Storm
> Issue Type: Improvement
> Components: storm-kafka
> Affects Versions: 0.10.0, 1.0.0
> Reporter: darion yaphet
> Assignee: darion yaphet
>
> When topic selector is not specified, KafkaBolt will get topic name from
> storm config . We should make sure the topic name is not null .
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)