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

Sijie Guo commented on BOOKKEEPER-168:
--------------------------------------

> Are you sure about this? the tests check that subscribers are only getting as 
> many messages as the bound is set to.

{code}

+    MyOrderCheckingMessageHandlerCallback* cb =
+      new MyOrderCheckingMessageHandlerCallback(95);
+
+    Hedwig::MessageHandlerCallbackPtr handler(cb);
+    sub.startDelivery(topic, subid, handler);
+    
+    for (int i = 0; i < 10000; i++) {
+      if (cb->nextExpected() == 101) {
+       break;
+      } else {
+       sleep(1);
+      }
+    }
+    CPPUNIT_ASSERT(cb->nextExpected() == 101);
+  }

{code}

from the test case, it would received 6 messages while the bound was 5. 
Received 5 or 6 messages is OK for me (although I prefer it received 5 
messages). My concern is that we should make clear that how many messages 
client should received, when user use this settings. otherwise it make user 
confused. It would better to make it clear in the documentation of this setting.

> I did have this originally in my first draft, but it looked messy to me. Do 
> you have a usecase for this right now, or is it just speculative?

in a proxy-style server using hedwig client, it usually initializes a client 
instance to handle/proxy the subscriptions. if we want to support different 
application/subscription having different size-bound, we have to construct 
multiple client instances, which make it complex.
                
> Message bounding on subscriptions
> ---------------------------------
>
>                 Key: BOOKKEEPER-168
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-168
>             Project: Bookkeeper
>          Issue Type: New Feature
>            Reporter: Ivan Kelly
>            Assignee: Ivan Kelly
>             Fix For: 4.1.0
>
>         Attachments: BOOKKEEPER-168.diff, BOOKKEEPER-168.diff
>
>
> In hedwig, messages for a subscription will queue up forever if the 
> subscriber is offline. In some usecases, this is undesirable, as it will 
> eventually mean resource exhaustion. In this JIRA we propose an optional 
> change to the subscription contract, which allows the user to set a bound on 
> the number of messages which will be queued for its subscription while it is 
> offline.

--
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