Github user dfdemar commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2790#discussion_r207649108
  
    --- Diff: 
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/bolt/KafkaBolt.java
 ---
    @@ -62,6 +62,7 @@
         private OutputCollector collector;
         private TupleToKafkaMapper<K,V> mapper;
         private KafkaTopicSelector topicSelector;
    +    private Callback providedCallback;
    --- End diff --
    
    What about something like this? Not sure if `OutputCollector` is necessary 
or not.
    
    ```java
    public interface PreparedCallback extends Callback, Serializable {
        void prepare(Map<String, Object> topoConf, TopologyContext context, 
OutputCollector outputCollector);
    }
    ```
    
    So if the `PreparedCallback` is not null, then KafkaBolt would call 
`.prepare()` during `KafkaBolt.prepare()`.
    
    The one concern I have is that it might be open for abuse by tempting 
people to use it to inject logic into the bolt preparation that's unrelated to 
Kafka publishing.


---

Reply via email to