Pavel Grochal created STORM-1870:
------------------------------------
Summary: Allow FluxShellBolt/Spout set custom "componentConfig"
via yaml.
Key: STORM-1870
URL: https://issues.apache.org/jira/browse/STORM-1870
Project: Apache Storm
Issue Type: Improvement
Components: Flux
Reporter: Pavel Grochal
FluxShellBolt/Spout should have option to provide custom config option when
importing topology from YAML file.
We use this to provide custom configuration for example to our python RabbitMQ
bolts. (Passing strings and list of strings).
We are using this code:
{code:title=FluxShellBolt.java|borderStyle=solid}
public class FluxShellBolt extends ShellBolt implements IRichBolt {
//... (rest of the class)
public void addComponentConfig(String key, Object value) {
this.componentConfig.put(key, value);
}
public void addComponentConfig(String key, Object[] value) {
this.componentConfig.put(key, value);
}
}
{code}
And our YAML file:
{code:title=topology.yaml|borderStyle=solid}
bolts:
- className: org.apache.storm.flux.wrappers.bolts.FluxShellBolt
configMethods:
- name: addComponentConfig
args: [rabbitmq.configfile, etc/rabbit.yml]
- name: addComponentConfig
args:
- publisher.data_paths
- [actions]
... (rest of yaml file)
{code}
It works fine, however it produces this type of warning:
{code}
WARN o.a.s.f.FluxBuilder - Found multiple invokable methods for class class
org.apache.storm.flux.wrappers.bolts.FluxShellBolt, method addComponentConfig,
given arguments [publisher.data_paths, [actions]]. Using the last one found.
{code}
Which fortunately happens to be correct method, but it is not correct solution.
Any ideas?
It is quite needed to provide custom config to ShellSpout/Bolt, since we run
all spouts/bolts in python via this option. It would be nice to have this
option in official release.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)