title: Apache Camel: Send half of data to one route and other half to second route. Camel Load balancer not working
body: <p>I have a use case of sending messages reading from file and send half of the total records to one kafka producer and other half to second kafka producer.</p>
  <p>I tried with load balancing option. It does send to only one producer(the first one).</p>
  <pre><code>from(itemFileConfig.getWorkingDir())
                  .log(&quot;Entered into file consumption part::&quot;)
                  .autoStartup(true)
                  .process(fileProcessor)
                  .loadBalance()
                  .roundRobin()
                  .to(&quot;direct:kafkaPosting1&quot;)
                  .to(&quot;direct:kafkaPosting2&quot;)
                  .end();
  
  
  from(&quot;direct:kafkaPosting1&quot;)
                  .split(body().tokenize(&quot;\n&quot;))
                  .to(&quot;kafka:&quot; + config.getTopicName() + &quot;?&quot; + &quot;brokers=&quot; +
                          config.getBoostStapServers1() + &quot;&amp;&quot; +&quot;serializerClass=&quot; +
                          config.getSerializer())
                  .end();
  
  
  
  from(&quot;direct:kafkaPosting2&quot;)
                      .split(body().tokenize(&quot;\n&quot;))
                      .to(&quot;kafka:&quot; + config.getTopicName() + &quot;?&quot; + &quot;brokers=&quot; +
                              config.getBoostStapServers2() + &quot;&amp;&quot; +&quot;serializerClass=&quot; +
                              config.getSerializer())
                      .end();
  </code></pre>
  <p>Any help or idea would be very much appreciated.
  I see content based routing using choice but I need a predicate of something like even-odd to separate it out.. Didn't find any help online on the same..</p>
  <p>Thanks in advance</p>