On Sun, Dec 12, 2010 at 7:07 AM, John <[email protected]> wrote: > > Hi, > > I am using camel 2.2, though I did give this a shot with 2.5 > > I have a route that has an http endpoint that is configured at startup. In > my route builder I have something like: > > String wsUrl = "http://host/ws"; > > from("activemq:somequeue") > .bean("someBean") > .to(wsUrl); > > While trying to create a unit test for this route, I am adding an > interceptSendToEndpoint to direct any requests to the wsUrl endpoint to a > mock endpoint. > > I am unable to get the interceptor to work as long as I have a variable in > the original route endpoint. If I replace .to(wsUrl) with > .to("http://host/ws") everything works fine in my test. The documentation > mentions that interceptSendToEndpoint should be fine with a dynamic URI. >
Read the documentation, you can use wildcards in the interceptor, for example a * or an reg exp expressions http://camel.apache.org/intercept.html And in later Camel releases you can use property placeholders in your routes to avoid hardcoding http://camel.apache.org/properties.html > Is there a way to use the interceptor in my test without a hard coded string > in the route endpoint? > > Thanks, > > -john > > -- > View this message in context: > http://camel.465427.n5.nabble.com/interceptSendToEndpoint-with-dynamic-endpoint-tp3301978p3301978.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
