title: Kafka consumer using Apache Camel
body: <p>I am new to Apache camel. we are doing POC to develop kafka consumer using Camel. Below is the sample code.</p>
  
  <pre><code>    context.addRoutes(new RouteBuilder(){
  
        @Override
          public void configure() throws Exception {
              // TODO Auto-generated method stub
  
           from("kafka:{{consumer.topic}}?brokers={{kafka.host}}:{{kafka.port}}" 
                       + "&amp;consumersCount={{consumer.consumersCount}}" 
                       + "&amp;seekTo={{consumer.seekTo}}" 
                       + "&amp;groupId={{consumer.group}}")
               .process(new Processor() {
  
                  @Override
                  public void process(Exchange exchange) throws Exception {
  
                      Message message = exchange.getIn();
                      Object data = message.getBody();
  
                      System.out.println(data);
                  }
               })
               .to("seda:end");
  
  
    });
  
          context.start();
  
      ConsumerTemplate template=context.createConsumerTemplate();
      String info=template.receiveBody("seda:end",String.class);
  
      System.out.println(info);
  }
  </code></pre>
  
  <p>I am having below issues:</p>
  
  <ol>
  <li>Context stops immediately after start.</li>
  <li>If I poll To endpoint using consumer template, it does not print anything whereas inside .process(), I am able to print kafka messages when I start context in infinite loop. Why consumer template is not able to print.</li>
  </ol>