You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by yli <yi...@gmail.com> on 2010/11/02 22:16:26 UTC
is that possible to use properties in the uri attribute of
InterceptSendToEndpoint?
Hi All,
I am trying to use properties in the uri part of
InterceptSendToEndpoint, but no luck.
Here is example code(I am using spring and Camel 2.4):
<bean id="properties"
class="org.apache.camel.component.properties.PropertiesComponent" />
<property name="locations" value="common.properties" />
</bean>
<camel: camelContext id="context">
...
<camel:intercaptSendToEndpoint uri="{{sendingURL}}">
<camel:log message="intercepted!" />
</camel:intercaptSendToEndpoint>
...
</camel:camelContext>
In the property file "common.properties", I have "sendingURL=
http://10.1.201.225/myService".
As you may have figured out, I wanted to intercept all messages that
are sent to an http endpoint(http://10.1.201.225/myService) and print
"intercepted!" in the log.
I have also tried to use uri="${properties:sendingURL}", but it
didn't work either.
However, when I replaced uri="{{sendingURL}}" with uri="
http://10.1.201.225/myService", it just worked.
Please correct me if I missed anything in the usage of properties
component and the intercepter.
When reading the camel document(
http://camel.apache.org/intercept.html), I found InterceptSendToEndpoint is
"dynamic" and supports wildcard and regular expression. Doesn't it support
properties?
Thank you very much.
Best
Yiming
--
View this message in context: http://camel.465427.n5.nabble.com/is-that-possible-to-use-properties-in-the-uri-attribute-of-InterceptSendToEndpoint-tp3247537p3247537.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: is that possible to use properties in the uri attribute of InterceptSendToEndpoint?
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
This is possible with Camel 2.5 onwards. (CAMEL-3210)
On Tue, Nov 2, 2010 at 10:16 PM, yli <yi...@gmail.com> wrote:
>
> Hi All,
> I am trying to use properties in the uri part of
> InterceptSendToEndpoint, but no luck.
> Here is example code(I am using spring and Camel 2.4):
>
> <bean id="properties"
> class="org.apache.camel.component.properties.PropertiesComponent" />
> <property name="locations" value="common.properties" />
> </bean>
>
> <camel: camelContext id="context">
> ...
> <camel:intercaptSendToEndpoint uri="{{sendingURL}}">
> <camel:log message="intercepted!" />
> </camel:intercaptSendToEndpoint>
> ...
> </camel:camelContext>
>
> In the property file "common.properties", I have "sendingURL=
> http://10.1.201.225/myService".
> As you may have figured out, I wanted to intercept all messages that
> are sent to an http endpoint(http://10.1.201.225/myService) and print
> "intercepted!" in the log.
> I have also tried to use uri="${properties:sendingURL}", but it
> didn't work either.
> However, when I replaced uri="{{sendingURL}}" with uri="
> http://10.1.201.225/myService", it just worked.
>
> Please correct me if I missed anything in the usage of properties
> component and the intercepter.
>
> When reading the camel document(
> http://camel.apache.org/intercept.html), I found InterceptSendToEndpoint is
> "dynamic" and supports wildcard and regular expression. Doesn't it support
> properties?
> Thank you very much.
>
> Best
> Yiming
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/is-that-possible-to-use-properties-in-the-uri-attribute-of-InterceptSendToEndpoint-tp3247537p3247537.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/