Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Apache Storm: tick tuple not working

Apache Storm: tick tuple not working

New Contributor

Hi Experts,

In my Storm based application I need to query oracle table periodically So I thought to use Tick tuple of storm. But it's not giving correct result and tick tuple is not producing. My storm version is 1.0.1.2.5.3.0-37

I tried as below,

1. Added getComponentConfiguration method in bolt but tick tuple is not generating.

2. So I changed the code and used Config from topology for generating tick tuple. But got tick tuple only once.

Below is my code of tick tuple with bolt,

public class TickTupleBolt implements IRichBolt{

private OutputCollector collector = null;
private static final long serialVersionUID = 1L;
private static final Logger LOG = LoggerFactory.getLogger(TickTupleBolt.class);

public void prepare(Map stormConf, TopologyContext context,OutputCollector collector) {
    this.collector = collector;     
}

public void execute(Tuple tuple) {
    LOG.info("Start of TickTupleBolt.execute");     
     try {
            if (isTickTuple(tuple)) {
            //if(tuple.getSourceStreamId().equals("__tick")){
                LOG.info("**got tick tuple");
            }else{
                LOG.info("not got tick tuple");
            }

        } catch (Exception e) {
            LOG.error("Bolt execute error: {}", e);
            collector.reportError(e);
        }       
     LOG.info("End of TickTupleBolt.execute");

}

public void cleanup() {
    // TODO Auto-generated method stub

}

public void declareOutputFields(OutputFieldsDeclarer declarer) {
    // TODO Auto-generated method stub

}

So can any body please let me know,

1. How to implement tick tuple in Storm

2. Is there any other way (apart from tick tuple) to do periodic job in storm

Thanks.

1 REPLY 1

Re: Apache Storm: tick tuple not working

New Contributor

tuple.getSourceComponent() and tuple.getSourceStreamId() always return spout name and default values. please help.

Don't have an account?
Coming from Hortonworks? Activate your account here