storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Luu <manga...@gmail.com>
Subject Have a node.js storm bolt, etc. reading storm topology config?
Date Wed, 13 Apr 2016 20:16:17 GMT
I notice the storm.js base classes initialize with some storm config
definition.

We have some python bolts that pull storm config info defined in the
topology like this:

class SomeBolt (storm.BasicBolt):

def _configure(self, stormconf):
        self.some_param = stormconf.get('some.param', DEFAULT_VALUE)
  ...
def initialize(self, stormconf, context):
        self._configure(stormconf)

How to do the same for node.js? (Asking as I'm so far the lone node.js
storm user at my organization).

I'm thinking something like below, but I could be mistaken. Please
confirm/clarify, thanks.

SomeBolt.prototype = Object.create(BasicBolt.prototype);
SomeBolt.prototype.constructor = SomeBolt;

function SomeBolt(conf) {
  BasicBolt.call(this);
  this.someParam = conf.someParam; //or conf['someParam']
};

Mime
View raw message