why you need to close the subscriber channel? as you described NoResponseHandlerException is caught when channel disconnected. so the topicSubscriberChannel would have been closed before NoResponseHandlerException occurred.
The new channel doesn't have any of the previously sent message callbacks. close() would explicitly clear all of them and force the client to resubscribe. I thought this behavior would be more apt.
same comment as previous one.
Same as above.
why move to try block?
We got here possibly because the channel was disconnected. So we don't try to close it again. I'm open to moving it out of the try block,though. I don't like the awaitUninterruptibly() there. Is there any reason why we need to wait?
since we are closing the client, I would prefer to call close out of try block. we need to ensure the channel is closed, otherwise if there is some channels are still opening, the client would not quit when calling 'socketFactory.releaseExternalResources();' in HedwigClient. Closing a closed channel doesn't take any effects, just we could guarantee that we would not be blocked to quit due to we doesn't cleanup the channel resources.
for 'awaitUninterruptibly', because it is to close the client, we had to wait to clean the channel.