forked from nathanmarz/storm
-
Notifications
You must be signed in to change notification settings - Fork 0
Hooks
nathanmarz edited this page Apr 2, 2012
·
1 revision
Storm provides hooks with which you can insert custom code to run on any number of events within Storm. You create a hook by extending the BaseTaskHook class and overriding the appropriate method for the event you want to catch. There are two ways to register your hook:
- In the prepare method of your spout or bolt using the TopologyContext#addTaskHook method.
- Through the Storm configuration using the "topology.auto.task.hooks" config. These hooks are automatically registered in every spout or bolt, and are useful for doing things like integrating with a custom monitoring system.