The hedwig java client does not remove a message handler for the topic (by calling stopDelivery) when we close a subscription channel. Because of this, when a subscription request goes through with another message handler, the subscription goes fine, but we can't start delivery. The only reason for keeping the message handler is to support restartDelivery. We should change the way restart delivery is handled by storing the existing message handler in the SubscribeReconnectCallback and forcing the subscribe handler to use it when we restart delivery.
This manifests as a bug in the region manager. When a topic moves from one hub to another and then returns to this hub, because the client still has a dangling MessageHandler, none of the subscriptions succeed because they can't start delivery. As an additional check, the region manager's client should not start delivery for a topic if there is an existing message handler. Any thoughts?