Here's how we do it. The argument we want to pass is 'env' set to 'prod'.
./bin/storm jar -c env=prod target/mytopology-jar-with-dependencies.jar
class.path.to.my.topology topo-name remote
in my topology class we have something like:
Map options = Utils.readCommandLineOpts();
String environment = (String) options.get("env");
conf.put("environment", environment);
Run from maven this looks like:
mvn compile exec:java -Dtopology.class=class.path.to.my.topology
-Dstorm.options=env%3Ddev
Hope this helps.
On Fri, Sep 25, 2015 at 1:47 PM, Patrick May <[email protected]>
wrote:
> I’m deploying my topology with “storm jar foo.jar fqn.Foo -c
> nimbus.host=hostname -c nimbus.thrift.port=6627”. I’d like to pass in the
> name of a properties file that’s included in my jar, but I haven’t found a
> way to do that. Passing it as a command line parameter to fqn.Foo doesn’t
> work. What’s the supported way to do this with Storm?
>
> Thanks,
>
> Patrick
>
>
>