[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420561#comment-13420561
 ] 

Sijie Guo commented on BOOKKEEPER-350:
--------------------------------------

sijie:

thanks for Mridul for explaining details.

from your explanation, actually what you need is different ack guarantees. so 
we could categorized the semantics of consume into several groups:

1) just guarantee sending consume request to local netty layer : if channel is 
closed before consume request written to server by netty, the consume request 
is lost. we would get duplicated messages.

2) just guarantee writing consume request to channel : if hub server is down 
before processing the consume request. we still get duplicated messages.

3) guarantee consume request is processed by hub server : we need response for 
consume request. in reality, we might not need such guarantee. I wrote it here, 
is just for completeness. 

so I think the better idea is to extend 'consume' api to support 
different-level consume guarantee, instead of introducing 'asyncConsume' api. I 
wrote an initial idea as below:

{code}
enum ConsumeMode {
    // provide different guarantee levels as described above.
    // I had no good names for it.
}

public void consume(topic, subscriberId, messageSeqId);

public void consume(topic, subscriberId, messageSeqId, ConsumeMode);
{code}

the original consume api still keeps semantic just sending consume requests to 
netty layer. we don't need to break the backward compatibility. and it makes 
semantic more clearly and extensible. also it could resolve the issue you 
mentioned.

@Mridul @Ivan, how are your opinions? 
                
> Revisit consume interface in Hedwig Client
> ------------------------------------------
>
>                 Key: BOOKKEEPER-350
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-350
>             Project: Bookkeeper
>          Issue Type: Sub-task
>          Components: hedwig-client
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Sijie Guo
>             Fix For: 4.2.0
>
>
> the jira is used to revisit consume interface in hedwig client and to improve 
> it to meet JMS provider's requirements.
> move comments from BOOKKEEPER-311 to here, which make discussion more 
> clearer. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to