Chuck Burgess created STORM-1126:
------------------------------------
Summary: How to Specify a configMethod that takes no arguments
Key: STORM-1126
URL: https://issues.apache.org/jira/browse/STORM-1126
Project: Apache Storm
Issue Type: Question
Components: Flux
Affects Versions: 0.10.0
Reporter: Chuck Burgess
Priority: Minor
Can the configMethod implementation handle calling a method that requires no
arguments? If so, I cannot figure out how to write that in the YAML.
```
configMethods
- name: "myMethod"
```
does not work:
```
Exception in thread "main" java.lang.NullPointerException
at
org.apache.storm.flux.FluxBuilder.findCompatibleMethod(FluxBuilder.java:445)
at
org.apache.storm.flux.FluxBuilder.invokeConfigMethods(FluxBuilder.java:424)
at org.apache.storm.flux.FluxBuilder.buildObject(FluxBuilder.java:302)
at
org.apache.storm.flux.FluxBuilder.buildComponents(FluxBuilder.java:339)
at org.apache.storm.flux.FluxBuilder.buildTopology(FluxBuilder.java:75)
at org.apache.storm.flux.Flux.runCli(Flux.java:153)
at org.apache.storm.flux.Flux.main(Flux.java:98)
```
```
configMethods
- name: "myMethod"
args:
```
does not work:
```
...
Caused by: java.lang.NullPointerException
at
org.apache.storm.flux.model.ConfigMethodDef.setArgs(ConfigMethodDef.java:45)
```
```
configMethods
- name: "myMethod"
args: []
```
does not work:
```
Exception in thread "main" java.lang.IllegalArgumentException: Unable to find
configuration method 'build' in class
'io.latent.storm.rabbitmq.config.ConsumerConfigBuilder' with arguments [].
at
org.apache.storm.flux.FluxBuilder.invokeConfigMethods(FluxBuilder.java:431)
at org.apache.storm.flux.FluxBuilder.buildObject(FluxBuilder.java:302)
at
org.apache.storm.flux.FluxBuilder.buildComponents(FluxBuilder.java:339)
at org.apache.storm.flux.FluxBuilder.buildTopology(FluxBuilder.java:75)
at org.apache.storm.flux.Flux.runCli(Flux.java:153)
at org.apache.storm.flux.Flux.main(Flux.java:98)
```
(presumably because this results in usage of `build( empty list)` rather than
just `build()`)
(originally filed at https://github.com/ptgoetz/flux/issues/17)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)