You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Sijie Guo (JIRA)" <ji...@apache.org> on 2012/05/10 10:21:06 UTC

[jira] [Created] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Sijie Guo created BOOKKEEPER-252:
------------------------------------

             Summary: Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
                 Key: BOOKKEEPER-252
                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
             Project: Bookkeeper
          Issue Type: New Feature
    Affects Versions: 4.1.0
            Reporter: Sijie Guo
            Assignee: Sijie Guo
             Fix For: 4.2.0


In some case, we need to hedwig-client as proxy server to provide messaging service to other users.

client -> proxy server 1 -> hedwig
       \> proxy server 2 />

when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.

we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.

the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.

so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.

when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.

in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.


 

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

        

[jira] [Commented] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13272185#comment-13272185 ] 

jiraposter@reviews.apache.org commented on BOOKKEEPER-252:
----------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/5086/
-----------------------------------------------------------

Review request for bookkeeper.


Summary
-------

In some case, we need to hedwig-client as proxy server to provide messaging service to other users.

client -> proxy server 1 -> hedwig
\> proxy server 2 />

when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.

we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.

the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.

so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.

when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.

in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.


This addresses bug BOOKKEEPER-252.
    https://issues.apache.org/jira/browse/BOOKKEEPER-252


Diffs
-----

  hedwig-client/src/main/cpp/inc/hedwig/callback.h 5200d5b 
  hedwig-client/src/main/cpp/inc/hedwig/subscribe.h fc8da58 
  hedwig-client/src/main/cpp/lib/channel.cpp ada1e58 
  hedwig-client/src/main/cpp/lib/clientimpl.h 40e063c 
  hedwig-client/src/main/cpp/lib/clientimpl.cpp 712de01 
  hedwig-client/src/main/cpp/lib/data.h d9d2ffd 
  hedwig-client/src/main/cpp/lib/data.cpp 42fa2ad 
  hedwig-client/src/main/cpp/lib/publisherimpl.cpp a421e98 
  hedwig-client/src/main/cpp/lib/subscriberimpl.h 508a495 
  hedwig-client/src/main/cpp/lib/subscriberimpl.cpp 6f7d02e 
  hedwig-client/src/main/cpp/test/subscribetest.cpp f90502c 
  hedwig-client/src/main/cpp/test/util.h 780a466 
  hedwig-client/src/main/java/org/apache/hedwig/client/api/Subscriber.java 972590b 
  hedwig-client/src/main/java/org/apache/hedwig/client/data/PubSubData.java 8460de0 
  hedwig-client/src/main/java/org/apache/hedwig/client/data/TopicSubscriber.java 064cec1 
  hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigPublisher.java 603766c 
  hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigSubscriber.java 0c8634c 
  hedwig-client/src/main/java/org/apache/hedwig/client/netty/ResponseHandler.java c4affaf 
  hedwig-client/src/main/java/org/apache/hedwig/util/SubscriptionChannelListener.java PRE-CREATION 
  hedwig-protocol/src/main/java/org/apache/hedwig/protocol/PubSubProtocol.java 92f409d 
  hedwig-protocol/src/main/protobuf/PubSubProtocol.proto b845c40 
  hedwig-server/src/main/java/org/apache/hedwig/admin/console/HedwigCommands.java a17f56b 
  hedwig-server/src/main/java/org/apache/hedwig/admin/console/HedwigConsole.java 5da8e16 
  hedwig-server/src/main/java/org/apache/hedwig/server/handlers/SubscribeHandler.java 76e0c14 
  hedwig-server/src/main/java/org/apache/hedwig/server/netty/PubSubServer.java 52089f5 
  hedwig-server/src/main/java/org/apache/hedwig/server/subscriptions/AbstractSubscriptionManager.java ba841af 
  hedwig-server/src/main/java/org/apache/hedwig/server/subscriptions/InMemorySubscriptionManager.java 0fdfad0 
  hedwig-server/src/main/java/org/apache/hedwig/server/subscriptions/ZkSubscriptionManager.java 4d39335 
  hedwig-server/src/test/java/org/apache/hedwig/client/TestPubSubClient.java 08994de 
  hedwig-server/src/test/java/org/apache/hedwig/server/PubSubServerStandAloneTestBase.java 5f6e363 
  hedwig-server/src/test/java/org/apache/hedwig/server/handlers/TestSubUnsubHandler.java d24a86d 
  hedwig-server/src/test/java/org/apache/hedwig/server/subscriptions/StubSubscriptionManager.java 255880b 
  hedwig-server/src/test/java/org/apache/hedwig/server/subscriptions/TestZkSubscriptionManager.java f6d533f 

Diff: https://reviews.apache.org/r/5086/diff


Testing
-------


Thanks,

Sijie


                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

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

        

[jira] [Commented] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455479#comment-13455479 ] 

Sijie Guo commented on BOOKKEEPER-252:
--------------------------------------

it is also updated in review board: https://reviews.apache.org/r/5086/diff/3/
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450721#comment-13450721 ] 

Ivan Kelly commented on BOOKKEEPER-252:
---------------------------------------

I still don't like this SubscriptionChannelListener, or rather I don't like passing it to the subscribe call at least. It adds to the main subscription API and exposes the connection logic to the client in a way which has been nicely hidden up until now. Moreover, I don't think it's necessary. We have a flag in the SubscriptionOptions with this change, forceAttach, which on disconnect, the client can check on channelDisconnect to decide whether to reconnect or not.

If you explicitly need notification at the application level, this is a different matter, and I think it should be separate to the reconnect logic. I think it highlights a shortcoming in the api. Currently, there is no means of notifying a client when a the service goes down, though we haven't needed it yet. However, if this is a requirement for your usecase, we should go about solving it, but without exposing the underlying connection.
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo updated BOOKKEEPER-252:
---------------------------------

    Attachment: BOOKKEEPER-252.diff

attach a patch based on latest trunk.
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

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

        

[jira] [Commented] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295576#comment-13295576 ] 

Ivan Kelly commented on BOOKKEEPER-252:
---------------------------------------

The idea seems sound. I'd prefer if these options were added to SubscriptionOptions though, rather than to CreateOrAttach mode. Call the option "steal" or "force" or something. 

I don't like how this has introduced a new set of APIs for subscribing. Why do we need to expose the connection logic to the client?

                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

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

        

[jira] [Commented] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295723#comment-13295723 ] 

Sijie Guo commented on BOOKKEEPER-252:
--------------------------------------

@Ivan

we need to disable reconnect when using kill subscription mode, otherwise the killed subscription channel would be established in reconnect logic.

so we have to expose disconnect event to client to let user aware of it when the channel is disconnected, when disabling reconnect.
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

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

        

[jira] [Commented] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451740#comment-13451740 ] 

Sijie Guo commented on BOOKKEEPER-252:
--------------------------------------

first of all, I have to clarify that disabling reconnect logic is necessary. if a subscriber subscribes with 'forceAttach', it would kill the existed attached subscription. the killed subscription would reconnect and kill the new one if we couldn't disable reconnect logic. so it would enter a killing-loop for the subscribers.

after disabling reconnect logic, we need some mechanism to get application notified with the events of the channel(the channel is broken due to hub failure, due to topic periodical release or other things). otherwise, application would not notice that it could not receive messages any more due to something is wrong.

so SubscriptionChannelListener is the mechanism we needed when enabling 'forceAttach'.

{quote}
alternatively merge it with MessageHandler,
{quote}

It is not only a BC break when merging it with MessageHandler. MessageHandler is just used to receive notifications, which is quite different to a listener on the events of a subscription channel. Because, application could start or stop a message handler according to its usage. I would have a use case to explain that.

Say a proxy server using a hedwig client to receive notifications from hub server and send to its downstream servers. A proxy server may #stopDelivery after receiving N messages from hub, which is to send these messages to its downstream and wait for their responses. If the connection to hub server is broken now, the proxy server would not get notified with it, since the message handler has been #stopDelivery. it just only get notified when it called #startDelivery, which might be a long delay. Bad thing is that a new message handler might be used calling #startDelivery.

{quote}
I think it would be better to register it with the Subscriber as a whole, if it is indeed needed.
{quote}

You are forcing all subscriptions for this subscriber to use same one. But different subscriptions has different behaviors. So I would prefer it would be subscription-level not client-level.
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo updated BOOKKEEPER-252:
---------------------------------

    Attachment: BOOKKEEPER-252.diff

attach a new patch rebased to latest trunk and addressed Ivan's previous's comment.

also upload to review board: https://reviews.apache.org/r/5086/
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13292647#comment-13292647 ] 

Sijie Guo edited comment on BOOKKEEPER-252 at 6/11/12 5:51 AM:
---------------------------------------------------------------

attach a patch based on latest trunk. the patch is generated based on BOOKKEEPER-191.
                
      was (Author: hustlmsp):
    attach a patch based on latest trunk.
                  
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

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

        

[jira] [Commented] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Aniruddha (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455916#comment-13455916 ] 

Aniruddha commented on BOOKKEEPER-252:
--------------------------------------

[~ikelly], If this is about passing the channel to the listener, I'm fine with it not being passed. 
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo updated BOOKKEEPER-252:
---------------------------------

    Attachment: BK-252.diff

attach a patch to provide kill/admin subscription mode as description.
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

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

        

[jira] [Updated] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo updated BOOKKEEPER-252:
---------------------------------

    Attachment: BOOKKEEPER-252.diff

attach a new patch addressing Ivan and Andiruddha's comments.
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo updated BOOKKEEPER-252:
---------------------------------

    Attachment: BOOKKEEPER-252.diff

Attach a new patch which provides a client-level subscription listener rather than per-subscription listener.

for now, those disable resubscribe feature subscriptions, 'TOPIC_MOVED' event will be emitted to the registered listener to notify a topic is moved when channel broken.
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450723#comment-13450723 ] 

Ivan Kelly commented on BOOKKEEPER-252:
---------------------------------------

Also, to clarify what i meant about passing it to the subscribe call, I think it would be better to register it with the Subscriber as a whole, if it is indeed needed. Or alternatively merge it with MessageHandler, though the problem there is that it would be a BC break.
                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (BOOKKEEPER-252) Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455962#comment-13455962 ] 

Hudson commented on BOOKKEEPER-252:
-----------------------------------

Integrated in bookkeeper-trunk #712 (See [https://builds.apache.org/job/bookkeeper-trunk/712/])
    BOOKKEEPER-252: Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server. (sijie via ivank) (Revision 1384836)

     Result = SUCCESS
ivank : 
Files : 
* /zookeeper/bookkeeper/trunk/CHANGES.txt
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/cpp/inc/hedwig/callback.h
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/cpp/inc/hedwig/subscribe.h
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/cpp/lib/data.cpp
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/cpp/lib/subscriberimpl.cpp
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/cpp/lib/subscriberimpl.h
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/cpp/test/subscribetest.cpp
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/cpp/test/util.h
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/api/Subscriber.java
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigClientImpl.java
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/HedwigSubscriber.java
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/client/netty/ResponseHandler.java
* /zookeeper/bookkeeper/trunk/hedwig-client/src/main/java/org/apache/hedwig/util/SubscriptionListener.java
* /zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/java/org/apache/hedwig/protocol/PubSubProtocol.java
* /zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/protobuf/PubSubProtocol.proto
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/admin/console/HedwigConsole.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/delivery/FIFODeliveryManager.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/handlers/SubscribeHandler.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/netty/PubSubServer.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/subscriptions/AbstractSubscriptionManager.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/subscriptions/InMemorySubscriptionManager.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/subscriptions/MMSubscriptionManager.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/TestPubSubClient.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/PubSubServerStandAloneTestBase.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/handlers/TestSubUnsubHandler.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/subscriptions/StubSubscriptionManager.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/subscriptions/TestMMSubscriptionManager.java

                
> Hedwig: provide a subscription mode to kill other subscription channel when hedwig client is used as a proxy-style server.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-252
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-252
>             Project: Bookkeeper
>          Issue Type: New Feature
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff, BOOKKEEPER-252.diff
>
>
> In some case, we need to hedwig-client as proxy server to provide messaging service to other users.
> client -> proxy server 1 -> hedwig
>        \> proxy server 2 />
> when client would connect to either proxy server to receive messages, the proxy server would setup subscription channel to hedwig server.
> we just want client to be simple, so when the channel between client and proxy server is broken, client will try to connect to proxy servers thru VIP. it might connect to other proxy server. for example, first time client connects to proxy server 1, but the client found the connection is broken, it connects to proxy server 2. when proxy server 2 tried to setup subscription channel to hedwig, hedwig found that this subscription has existed before occupied by proxy server 1.
> the panic here is that proxy server 1 only disconnect old subscription channel only when it detected the channel between client and itself is broken. The detection might be delayed due to several reasons. so it might increment the latency that messages are pushed to real client.
> so we try to introduce a subscription mode called CREATE_OR_ATTACH_OR_KILL mode.
> when a subscriber use this subscription mode, it would kill old existed subscription channel. when using this subscription mode, we would turn off auto-reconnect functionality in hedwig client and just tell client about the channel disconnected event so client could do its logic when channel is detected.
> in order to provide some admin tool for admin guys to debug/operate, we provide ADMIN mode. if a subscriber attach to a subscription using ADMIN mode, its subscription channel would never be killed, then it is safe to guarantee admin operations.
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira