You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pulsar.apache.org by Sijie Guo <gu...@gmail.com> on 2018/07/11 16:40:30 UTC

Re: Ack mode of individual pulsar

+users@pulsar

In the context of pulsar, when a consumer acks a message, it doesn’t remove
entries from bookkeeper. Instead, for each subscription at pulsar, pulsar
brokers use a separate ledger for storing the acknowledgments for each
subscription. When a broker receives individual acks, it writes an entry to
the cursor ledger marking that message as acknowledged, when the cursor
ledgers move beyond the data ledger, broker deletes the data ledger.

If ack failed, brokers will try to redeliver the unacked messages after
acks timeout. This is configured as ackTimeout when you construct a
consumer instance.

Hope this helps.

Sijie

On Wed, Jul 11, 2018 at 2:38 AM li.penghui@zhaopin.com.cn <
li.penghui@zhaopin.com.cn> wrote:

> In introduce of pulsar, i interest in ack mode of individual.
> I know that pulsar use bookkeeper to store messages, and entries in
> bookkeeper write only once.
> so i want to know how pulsar server do message ack in individual mode. if
> ack failed, how long will i receive the message again.
>
>

Re: Ack mode of individual pulsar

Posted by Sijie Guo <gu...@gmail.com>.
MLDataFormats is generated from protobuf definitions.

https://github.com/apache/incubator-pulsar/blob/master/managed-ledger/src/main/proto/MLDataFormats.proto

Hope that helps!

- Sijie

On Wed, Jul 11, 2018 at 7:07 PM li.penghui@zhaopin.com.cn <
li.penghui@zhaopin.com.cn> wrote:

> Thanks! I try to read the source code of ManagedCursor in pulsar project.
> I'm aready pull source code success. i tried branch  master 2.1 2.0 ,
> is any source code  submit not yet?
>
> example
>
> import org.apache.bookkeeper.mledger.proto.MLDataFormats;
>
>
> I can't find source code in package org.apache.bookkeeper.mledger.proto
>
> ------------------------------
> li.penghui@zhaopin.com.cn
>
>
> *From:* Sijie Guo <gu...@gmail.com>
> *Date:* 2018-07-12 00:40
> *To:* user <us...@bookkeeper.apache.org>; users@pulsar.incubator.apache.org
> *Subject:* Re: Ack mode of individual pulsar
> +users@pulsar
>
> In the context of pulsar, when a consumer acks a message, it doesn’t
> remove entries from bookkeeper. Instead, for each subscription at pulsar,
> pulsar brokers use a separate ledger for storing the acknowledgments for
> each subscription. When a broker receives individual acks, it writes an
> entry to the cursor ledger marking that message as acknowledged, when the
> cursor ledgers move beyond the data ledger, broker deletes the data ledger.
>
> If ack failed, brokers will try to redeliver the unacked messages after
> acks timeout. This is configured as ackTimeout when you construct a
> consumer instance.
>
> Hope this helps.
>
> Sijie
>
> On Wed, Jul 11, 2018 at 2:38 AM li.penghui@zhaopin.com.cn <
> li.penghui@zhaopin.com.cn> wrote:
>
>> In introduce of pulsar, i interest in ack mode of individual.
>> I know that pulsar use bookkeeper to store messages, and entries in
>> bookkeeper write only once.
>> so i want to know how pulsar server do message ack in individual mode.
>> if ack failed, how long will i receive the message again.
>>
>>

Re: Ack mode of individual pulsar

Posted by Sijie Guo <gu...@gmail.com>.
MLDataFormats is generated from protobuf definitions.

https://github.com/apache/incubator-pulsar/blob/master/managed-ledger/src/main/proto/MLDataFormats.proto

Hope that helps!

- Sijie

On Wed, Jul 11, 2018 at 7:07 PM li.penghui@zhaopin.com.cn <
li.penghui@zhaopin.com.cn> wrote:

> Thanks! I try to read the source code of ManagedCursor in pulsar project.
> I'm aready pull source code success. i tried branch  master 2.1 2.0 ,
> is any source code  submit not yet?
>
> example
>
> import org.apache.bookkeeper.mledger.proto.MLDataFormats;
>
>
> I can't find source code in package org.apache.bookkeeper.mledger.proto
>
> ------------------------------
> li.penghui@zhaopin.com.cn
>
>
> *From:* Sijie Guo <gu...@gmail.com>
> *Date:* 2018-07-12 00:40
> *To:* user <us...@bookkeeper.apache.org>; users@pulsar.incubator.apache.org
> *Subject:* Re: Ack mode of individual pulsar
> +users@pulsar
>
> In the context of pulsar, when a consumer acks a message, it doesn’t
> remove entries from bookkeeper. Instead, for each subscription at pulsar,
> pulsar brokers use a separate ledger for storing the acknowledgments for
> each subscription. When a broker receives individual acks, it writes an
> entry to the cursor ledger marking that message as acknowledged, when the
> cursor ledgers move beyond the data ledger, broker deletes the data ledger.
>
> If ack failed, brokers will try to redeliver the unacked messages after
> acks timeout. This is configured as ackTimeout when you construct a
> consumer instance.
>
> Hope this helps.
>
> Sijie
>
> On Wed, Jul 11, 2018 at 2:38 AM li.penghui@zhaopin.com.cn <
> li.penghui@zhaopin.com.cn> wrote:
>
>> In introduce of pulsar, i interest in ack mode of individual.
>> I know that pulsar use bookkeeper to store messages, and entries in
>> bookkeeper write only once.
>> so i want to know how pulsar server do message ack in individual mode.
>> if ack failed, how long will i receive the message again.
>>
>>

Re: Ack mode of individual pulsar

Posted by "li.penghui@zhaopin.com.cn" <li...@zhaopin.com.cn>.
Thanks! I try to read the source code of ManagedCursor in pulsar project. 
I'm aready pull source code success. i tried branch  master 2.1 2.0 , is any source code  submit not yet?

example  

import org.apache.bookkeeper.mledger.proto.MLDataFormats;

I can't find source code in package org.apache.bookkeeper.mledger.proto



li.penghui@zhaopin.com.cn
 
From: Sijie Guo
Date: 2018-07-12 00:40
To: user; users@pulsar.incubator.apache.org
Subject: Re: Ack mode of individual pulsar
+users@pulsar 

In the context of pulsar, when a consumer acks a message, it doesn’t remove entries from bookkeeper. Instead, for each subscription at pulsar, pulsar brokers use a separate ledger for storing the acknowledgments for each subscription. When a broker receives individual acks, it writes an entry to the cursor ledger marking that message as acknowledged, when the cursor ledgers move beyond the data ledger, broker deletes the data ledger.

If ack failed, brokers will try to redeliver the unacked messages after acks timeout. This is configured as ackTimeout when you construct a consumer instance.

Hope this helps.

Sijie

On Wed, Jul 11, 2018 at 2:38 AM li.penghui@zhaopin.com.cn <li...@zhaopin.com.cn> wrote:
In introduce of pulsar, i interest in ack mode of individual. 
I know that pulsar use bookkeeper to store messages, and entries in bookkeeper write only once.
so i want to know how pulsar server do message ack in individual mode. if ack failed, how long will i receive the message again.