The configure method is called *once* when Camel bootup and create the
runtime routes from the model (eg RouteBuilder's).

The JMS consumer is an event driven consumer
http://camel.apache.org/event-driven-consumer.html




On Fri, Sep 2, 2011 at 1:57 AM, kal2420 <kalpi...@cisco.com> wrote:
> Ashwin,
>
>   Thanks, I agree this is a bad approach.  I am a bit confused about how
> often configure() method is invoked and when the message would be read from
> the queue.  For Example:
>
>  public class TestRouteBuilder extends RouteBuilder {
>
>    public String current_State = "process";
>
>    @Override
>    public void configure() throws Exception {
>
>          String selector = generateSelectorURI(current_state);
>
>        from("activemq:queue:test?selector="+selector)
>                .to("log:test")
>                .process(new Processor() {
>
>                                        @Override
>                                        public void process(Exchange exchange) 
> throws Exception {
>
>                                                current_State="waiting";
>                                                sendSoapRequest("test");
>                                        }
>                                });
>    }
> }
>
> I only want to read and process messages if current_state is “process” ( so
> in "waiting" state change selector value so none of the messages would be
> read).
>
> What type of endpoint would camel create based on
> “from(“activemq:queue..”)” ?  ex: polled or scheduled endpoint.
>
> Would the selector uri get re-created on every read? does camel just change
> endpoint configuration or re-create a new endpoint ?
>
> If you have a good example on how to do dynamic selector with
> camel/activemq, I would love to see it.
>
> I really appreciate all your help.
>
> Thanks
> Kal
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Activemq-dynamic-endpoint-configuration-tp4749853p4760387.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to