title: Camel: forward message to dynamic destinations (from database)
body: <p>I am using camel 2.8.4 in my app. my app will receive request from a queue, then the request will be validated by a Validator. Base on the content of the message, the Validator will forward the request to different destinations. Validator will be a POJO bean. Destinations will be get from database (this is a MUST). I prefer to use spring dsl for camelContext. </p>
  
  <pre><code>1. I dont know how to write the validator to forward req to destinations.
  2. Can we use something similar like this 
      &lt;to uri='method=getURI() bean='Validator''&gt; in camelContext
  
  &lt;camelContext&gt;
         &lt;route id="route-1"&gt;
            &lt;from uri="mq:queue:QUEUE"/&gt;
            &lt;bean ref="Validator" method="validate"/&gt;
                 &lt;!--i would be great if we can use &lt;to uri="dynamicURI-from-database"&gt; here  --&gt;
         &lt;/route&gt; 
  &lt;/camelContext&gt;
  
  Class Validator{
      public void validate(String req){
       if (...)
           //get uri1 from database 
           String uri1=getURI(..);
           //forward req to uri1
             ...........
       else 
           //get uri2 from database 
            String uri2=getURI(...);
           //forward req to uri2
             ...........
  
      }
  
     public String getURI(..){
          ......
        return uri;
      }
  </code></pre>
  
  <p>}</p>