@Override public void run() { for (Map.Entry<ChannelHandler, Collection<ChannelReadRecipe>> entry : handlersWithSubscriptions.entrySet()) { ChannelHandler channelHandler = entry.getKey(); Collection<ChannelReadRecipe> channelRecipes = entry.getValue(); for (ChannelReadRecipe channelRecipe : channelRecipes) { try { channelHandler.addReader(channelRecipe.getReadSubscription()); } catch(Exception ex) { // If an error happens while adding the read subscription, // notify the appropriate handler channelRecipe.getReadSubscription().getExceptionWriteFunction().writeValue(ex); } } } } });