Github user mmiklavc commented on a diff in the pull request: https://github.com/apache/metron/pull/1250#discussion_r230212895 --- Diff: metron-platform/metron-common/src/main/java/org/apache/metron/common/bolt/ConfiguredEnrichmentBolt.java --- @@ -17,18 +17,41 @@ */ package org.apache.metron.common.bolt; +import java.io.IOException; import java.lang.invoke.MethodHandles; +import java.util.Map; + +import org.apache.http.impl.client.CloseableHttpClient; import org.apache.metron.common.configuration.EnrichmentConfigurations; +import org.apache.metron.stellar.common.utils.HttpClientUtils; +import org.apache.storm.task.OutputCollector; +import org.apache.storm.task.TopologyContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public abstract class ConfiguredEnrichmentBolt extends ConfiguredBolt<EnrichmentConfigurations> { private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + protected CloseableHttpClient httpClient; public ConfiguredEnrichmentBolt(String zookeeperUrl) { super(zookeeperUrl, "ENRICHMENT"); } + @Override + public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { + super.prepare(stormConf, context, collector); --- End diff -- More specifically, shouldn't this be isolated to the stellar function itself? This seems like a bleeding of concerns. With zookeeper, it makes sense to me because we're taking the architectural position that enabling dynamic, real-time configuration loading is part of the framework. I don't think that same general applicability applies to HttpClients. What about using the initialize method instead? ``` public interface StellarFunction { Object apply(List<Object> args, Context context) throws ParseException; void initialize(Context context); boolean isInitialized(); } ```
---