A Bolt's code is triggered when data arrives (an input tuple). How can we program code inside a Bolt to run even in the case of missing input data? I mean, if no tuple arrives how can we force an action to be accomplished? Are Timers allowed?
A Bolt's code is triggered when data arrives (an input tuple). How can we program code inside a Bolt to run even in the case of missing input data? I mean, if no tuple arrives how can we force an action to be accomplished? Are Timers allowed?
The main routine of a bolt is inside the execute-Function as documented here. To the best of my knowledge, this automatically called by the underlying supervisor, when a new tuple arrives and this is something you cannot easily change without forking Storm. However, if you want to have an ongoing routine in a bolt, than you could maybe start a parallel thread in the constructor.