您的位置:首页 > 其它

storm保证消息被处理

2013-01-13 21:21 267 查看
    storm保证离开spout的每个消息都会被成功处理。

What does it mean for a message to be "fully processed"?

    离开spout的tuple可以触发成千的tuple被创建。
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("sentences",
new KestrelSpout("kestrel.backtype.com",
22133,"sentence_queue",new StringScheme()));
builder.setBolt("split", new SplitSentence(), 10).shuffleGrouping("sentences");
builder.setBolt("count",new WordCount(),20).fieldsGrouping("split",new Fields("word"));

    次topology读取离开kestrel队列的句子,并将句子分割成连续的单词,最后对每个单词输出多次。离开spout的一个tuple触犯多个tuple被创建。消息树如下:



    当tuple tree被消耗完,且tree中的消息都被处理时,离开spout的tuple被认定"full process"。在指定超时时间内消息树没有被"full process"时,认为失败。此超时时间可以通过Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS配置,默认为30秒。

What happens if a message is fully processed or fails to be fully processed?

    

    
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: