风暴:是否可以限制失败(重播)时的重播次数? [英] Storm: Is it possible to limit the number of replays on fail (Anchoring)?
本文介绍了风暴:是否可以限制失败(重播)时的重播次数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用锚点时是否有限制重播次数的选项? 我有一个元组应该解析json对象,以防万一它遇到异常,我希望它可以重播两次.
Is there an option to limit the number of replays when using anchoring? I have a tuple that should parse json object, in case it gets an exception I prefer it will replay two more times.
我试图跟踪风暴重现打印的次数,但是每次我输入不可解析的值时,计数器都会显示不同的结果.
I tried to track the number of times storm is replaying with prints, but each time I entered non parse-able value the counter showed different result.
catch{
collector.fail(tuple)
}
推荐答案
BaseRichSpout
类中的fail
方法为空.这意味着您应该重写相同的方法来处理失败的元组回复策略.
The fail
method in the BaseRichSpout
class is empty . meaning you are supposed to override the same method to handle the failed tuple reply strategy.
这篇关于风暴:是否可以限制失败(重播)时的重播次数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文