Property placeholders is intended to be supported on <from> and
<interceptFrom> also. So if it does not work, then it sounds like a
little bug.



On Thu, Sep 12, 2013 at 6:32 PM, Steve <debianclus...@gmail.com> wrote:
> Hello Camel-Users,
>
> Can property placeholders be used in the URI supplied to the
> interceptFrom(String) method belonging to the RouteBuilder class?  My
> apologies if this topic is covered by existing documentation; if so, I did
> not see it.
>
> I was reading CAMEL-5129 which addressed a similar issue, but that appeared
> to be when a placeholder was used in the URI  passed in a from(String)
> method call.  I examined the unit-test associated with the JIRA issue and
> it did not cover my particular scenario.
>
> I have been attempting to use a property placeholder in both the
> "interceptFrom" and "from" method calls without much success. The following
> example demonstrates my usage:
>
> Example:
>
> interceptFrom("activemq:{{jms.order.destination}}")
>     .when(header("MSG_TYPE").isNotEqualTo("ORDER"))
>     .to("direct:ERROR").stop();
>
> from("activemq:{{jms.order.destination}}")
>     .to("file:{{file.order.inbox}}");
>
> In this case the Exchange is not intercepted.  In contrast, if the
> "interceptFrom" has a hard-coded value then the Exchange is intercepted as
> expected (where "jms.order.destination" = "ORDERS":
>
> interceptFrom("activemq:ORDERS")
>     .when(header("MSG_TYPE").isNotEqualTo("ORDER"))
>     .to("direct:ERROR").stop();
>
> from("activemq:{{jms.order.destination}}")
>     .to("file:{{file.order.inbox}}");
>
>
> This is likely the correct behavior, but I was hoping to receive
> confirmation in that regard.
>
> Environment:
> - Camel version:  2.10.0.redhat-60024 (though I tried 2.11.1 as well)
> - Oracle JDK 1.7.x
>
> Many thanks,
>
> -Steve



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to