You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Chen Junfeng <k-...@hotmail.com> on 2016/06/15 10:14:46 UTC

Messages lost when emitted from one bolt to another

I found when I emit some messages from one bolt to another bolt, some of them are lost.

I counted the number of messages emitted in first bolt and the number of messages received in the beginning of excute() method in the second bolt. The two numbers should be equal but actually nearly half of them are lost.

Does anyone meet the similar problem?


发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用


答复: Messages lost when emitted from one bolt to another

Posted by Chen Junfeng <k-...@hotmail.com>.
I found “Each word tuple is anchored by specifying the input tuple as the first argument to emit.”in the linked you gave. Does it mean the tuple I send will be anchored automatically?  And do I have to override the fail() method inside the spout? Or it will resend un-acked tuple automatically?

发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用

发件人: Navin Ipe<ma...@searchlighthealth.com>
发送时间: 2016年6月15日 18:59
收件人: user@storm.apache.org<ma...@storm.apache.org>
主题: Re: Messages lost when emitted from one bolt to another

Everyone faces this issue. That's why we anchor the tuples while emitting from the bolt, so that if it does not get delivered, the spout's fail() method will receive the failure notification. Make sure you anchor your tuples<http://storm.apache.org/releases/current/Guaranteeing-message-processing.html> and use the fail() method:

    @Override
    public void fail(Object msgId) {
        if (msgId instanceof MyClass) {
            MyClass one = (MyClass) msgId;
        }
}


On Wed, Jun 15, 2016 at 3:44 PM, Chen Junfeng <k-...@hotmail.com>> wrote:
I found when I emit some messages from one bolt to another bolt, some of them are lost.

I counted the number of messages emitted in first bolt and the number of messages received in the beginning of excute() method in the second bolt. The two numbers should be equal but actually nearly half of them are lost.

Does anyone meet the similar problem?


发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用




--
Regards,
Navin

Re: Messages lost when emitted from one bolt to another

Posted by Navin Ipe <na...@searchlighthealth.com>.
Everyone faces this issue. That's why we anchor the tuples while emitting
from the bolt, so that if it does not get delivered, the spout's fail()
method will receive the failure notification. Make sure you anchor your
tuples
<http://storm.apache.org/releases/current/Guaranteeing-message-processing.html>
and use the fail() method:

    @Override
    public void fail(Object msgId) {
        if (msgId instanceof MyClass) {
            MyClass one = (MyClass) msgId;
        }
}


On Wed, Jun 15, 2016 at 3:44 PM, Chen Junfeng <k-...@hotmail.com> wrote:

> I found when I emit some messages from one bolt to another bolt, some of
> them are lost.
>
>
>
> I counted the number of messages emitted in first bolt and the number of
> messages received in the beginning of excute() method in the second bolt.
> The two numbers should be equal but actually nearly half of them are lost.
>
>
>
> Does anyone meet the similar problem?
>
>
>
>
>
> 发送自 Windows 10 版邮件 <https://go.microsoft.com/fwlink/?LinkId=550986>应用
>
>
>



-- 
Regards,
Navin