title: Apache Camel listener
body: <p>I have created a router class and marked as a @Bean in @Configuration. One thing I am not very much sure is how frequently camel would be making a database call to get the select result? As soon as I have a new entry in the database, camel retrieve and process it.</p>
  
  <pre><code>public class SQLRouteBuilderForNewUserProcessing extends RouteBuilder {
  
      @Override
      public void configure() throws Exception {
          //files refer camel files endpoint
          //noop will not move or delete the files
          from("sql:" +
               "select id from users where status=" + Status.NEW.ordinal() +
               "?" +
               "consumer.onConsume=update users set status = " + Status.PROCESSING.ordinal()
               " where id = :#id")
              .bean(UserDataTranslator.class, "transformToUserData")
              .to("log:uk.co.infogen.users?level=INFO");
      }
  }
  </code></pre>