简体   繁体   中英

Apache Storm: get Topology name inside a Bolt

How can I get the name of the current topology inside a BaseRichBolt implementation? I see that I have access to the stormConfig Map and the TopologyContext from the prepare() call, but it isn't obvious how to get the name of the running topology from either of these.

You can get it from the config map.
Use config.get(Config.TOPOLOGY_NAME)

http://nathanmarz.github.io/storm/doc/backtype/storm/Config.html#TOPOLOGY_NAME

@ComputerDruid thanks for the correction

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM