My application has a route defined like:

public MyRoute extends RouteBuilder implements InitializingBean,
DisposableBean
{
    private String host;
    private String user;
    private String pw;

    private String wsUrl;

    afterPropertiesSet()
    {
        wsUrl = "http://"; + host + "/some_ws" + "?username=" + user +
"&password=" + pw;
    }

    public void configure()
    {
        from("activemq:somequeue")
            .bean("someBean")
            .to(wsUrl);
    }
}

In my spring xml I define:

<camelContext xmlns="http://camel.apache.org/schema/spring"; trace="true">
    <camel:routeBuilder ref="myRoute"/>        
</camelContext>

<bean name="myRoute" class="com.MyRoute">
    <property name="host" value="${myroute.host}" />
    <property name="user" value="${myroute.user}" />
    <property name="pw" value="${myroute.pw}" />
</bean>

So I'm trying to create a unit test with a mock endpoint for the web service
call in the route. To do that I'm attempting to add the interceptor via
adviceWith that I showed above. I can't get the interceptor to actually work
though when my original route uses the wsUrl variable. If I replace wsUrl
with the String "http://some_stuff"; the interceptor works fine.

Thanks,

-john
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/interceptSendToEndpoint-with-dynamic-endpoint-tp3301978p3303122.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to