System.out.println("End of channel group");
channelGroup.close().awaitUninterruptibly();
comGroup.close().awaitUninterruptibly();
// Close the executor for Pipeline
System.out.println("End of pipeline executor");
pipelineExecutor.shutdownNow();
// Now release resources
System.out.println("End of resources");
factory.releaseExternalResources();
comFactory.releaseExternalResources();
}