title: Failed to create Producer for endpoint when using Camel-Kafka's ProducerTemplate sendBody() method
body: <p>I am testing simple producer to send messages on Kafka (0.8.2.1) using Apache Camel. I have created endpoint using java DSL in camel.</p>
  
  <pre><code>CamelContext ctx =new DefaultCamelContext();
  PropertiesComponent properties=new PropertiesComponent();
  
  properties.setLocation("com/camel/test/props.properties");
  ctx.addComponent("properties",properties);
  
  final String uri= "kafka://{{kafka.host}}?topic={{topic}}&amp;zookeeperHost={{zookeeperHost}}&amp;zookeeperPort={{zookeeperPort}}";
  String uriParams = "&amp;metadata.broker.list={{metadata.broker.list}";
  
  ctx.addRoutes(new RouteBuilder() {
      public void configure() { //
          from(uri+"&amp;groupId={{groupId}}")
          .process(new Processor() {
              @Override
              public void process(Exchange exchange) throws Exception {
                  System.out.println(exchange.getIn().getBody());
              }
          })
          ;
      }
  });
  
  
  ctx.start();
  
  ProducerTemplate tmp = ctx.createProducerTemplate();
  tmp.sendBody(ctx.getEndpoint(uri), "my test is working");// Error occurs here
  </code></pre>
  
  <p>now I want to send message on kafka using ProducerTempalte provided by Apache Camel. but I get below error when runs the program 
  Note: Zookeeper &amp; Kafka are up and can produce/consume messages using kafka console.</p>
  
  <pre><code>Exception in thread "main" org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[kafka://localhost:9092?topic=test&amp;zookeeperHost=localhost&amp;zookeeperPort=2181]. Reason: java.lang.NullPointerException
      at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:407)
      at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:220)
      at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:343)
      at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:184)
      at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:124)
      at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:137)
      at com.camel.test.CamelTest.main(CamelTest.java:45)
  Caused by: java.lang.NullPointerException
      at java.util.Hashtable.put(Hashtable.java:514)
      at org.apache.camel.component.kafka.KafkaProducer.getProps(KafkaProducer.java:54)
      at org.apache.camel.component.kafka.KafkaProducer.doStart(KafkaProducer.java:61)
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
      at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2869)
      at org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:1097)
      at org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:1058)
      at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:405)
      ... 6 more
  </code></pre>
  
  <p>I guess the properties are not set for the producer but have no idea how to set in producer template.</p>