Storm:是否可以限制失败时的重播次数(锚定)? [英] Storm: Is it possible to limit the number of replays on fail (Anchoring)?

查看:32
本文介绍了Storm:是否可以限制失败时的重播次数(锚定)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用锚定时是否有限制重播次数的选项?我有一个应该解析 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.

我试图跟踪 Storm 用打印重播的次数,但每次我输入不可解析的值时,计数器都会显示不同的结果.

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.

这篇关于Storm:是否可以限制失败时的重播次数(锚定)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆