Instead of using a TriggerSpout, you could add ticks into your bolt. Add the following to your bolt implementation:
import backtype.storm.Constants;
@Override
public Map<String, Object> getComponentConfiguration() {
Config conf = new Config();
conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, 15);
return conf;
}
public static boolean isTickTuple(Tuple tuple) {
String sourceComponent = tuple.getSourceComponent();
String sourceStreamId = tuple.getSourceStreamId();
return sourceComponent.equals(Constants.SYSTEM_COMPONENT_ID)
&& sourceStreamId.equals(Constants.SYSTEM_TICK_STREAM_ID);
}
In your execute() method, you first check whether the input is a tick tuple, then proceed with your logic.