title: Netty - Find Channel ID
body: <p>I just started working with Netty. I already have a server, and im writing code for a client.</p>
  
  <p>In the client, i set a new PipelineFactory for the ClientBootstrap object with this code</p>
  
  <pre><code>    bootstrap.setPipelineFactory(new ChannelPipelineFactory() 
      {
          public ChannelPipeline getPipeline() 
          {
              return Channels.pipeline(new ResponseHandler());
          }
      }
                                  );
  </code></pre>
  
  <p>where ResponseHandler() is my class that extends SimpleChannelHandler.</p>
  
  <p>Im looking to find the Channel ID. I did</p>
  
  <pre><code> bootstrap.getPipeline().getChannel().getId();
  </code></pre>
  
  <p>but it throws IllelgalStateException and says i cant call getPipeline() because i have called setPipelineFactory(). What is the method to obtain the Channel ID ?</p>