You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by martin11 <ma...@gmail.com> on 2013/02/14 09:20:28 UTC

Intercept HTTP where I use httpClientConfigurerRef

Hello,

I`m using http component for calling some web services and because of SSL I
created my own HttpClientConfigurer.
<to
uri="http://someAddress/context?httpClientConfigurerRef=myHttpClientConfig"/>

I also have a Unit Tests for production context where I intercept http
calls.
Since I switched on SLL interceptSendToEndpoint("http:*") does not work. I
tried to remove httpClientConfigurerRef from http calls in context and
intercept works fine.

How can I use interceptor in http component when I use
httpClientConfigurerRef parameter? 
Is there a bug or I missed something?

I use Camel ver. 2.10.2.

Thanks for any help.



--
View this message in context: http://camel.465427.n5.nabble.com/Intercept-HTTP-where-I-use-httpClientConfigurerRef-tp5727569.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Intercept HTTP where I use httpClientConfigurerRef

Posted by martin11 <ma...@gmail.com>.
Willem, thanks for a good hint.

Because I need to use SSL and I also want JUnit tests on production context
then I will replace all my ref to endpoint uri.
Now the issue is clear.




--
View this message in context: http://camel.465427.n5.nabble.com/Intercept-HTTP-where-I-use-httpClientConfigurerRef-tp5727569p5727737.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Intercept HTTP where I use httpClientConfigurerRef

Posted by Willem jiang <wi...@gmail.com>.
Hi,

Current interceptSendToEndpoint doesn't support the intercept the endpoint as you showed.
You can check the TODO comment of the InterceptSendToEndpointDefinition[1] for detail information.

[1]https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Monday, February 18, 2013 at 8:28 PM, martin11 wrote:

> UPDATE:
> --------------
> Intercept is not working only when I use ref to endpoint with
> httpClientConfigurerRef.
>  
> <camel:endpoint id="wsEndpoint"
> uri="http://{{address}}/{{context}}?httpClientConfigurerRef=myHttpClientConfig"/>
>  
> <camel:route id="route-1">
> ...
> <camel:to ref="wsEndpoint"/>
> ...
> </camel:route>
>  
> But interceptSendToEndpoint works fine if I use uri instead of endpoint ref:
> <camel:route id="route-1">
> ...
> <camel:to
> uri="http://{{address}}/{{context}}?httpClientConfigurerRef=myHttpClientConfig"/>
> ...
> </camel:route>
>  
> Why I can`t use endpoint ref together with httpClientConfigurerRef when I
> want interceptSendToEndpoint in test?  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Intercept-HTTP-where-I-use-httpClientConfigurerRef-tp5727569p5727730.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Re: Intercept HTTP where I use httpClientConfigurerRef

Posted by martin11 <ma...@gmail.com>.
UPDATE:
--------------
Intercept is not working only when I use ref to endpoint with
httpClientConfigurerRef.

<camel:endpoint id="wsEndpoint"
uri="http://{{address}}/{{context}}?httpClientConfigurerRef=myHttpClientConfig"/>

<camel:route id="route-1">
    ...
    <camel:to ref="wsEndpoint"/>
    ...
</camel:route>

But interceptSendToEndpoint works fine if I use uri instead of endpoint ref:
<camel:route id="route-1">
    ...
    <camel:to
uri="http://{{address}}/{{context}}?httpClientConfigurerRef=myHttpClientConfig"/>
    ...
</camel:route>

Why I can`t use endpoint ref together with httpClientConfigurerRef when I
want interceptSendToEndpoint in test? 



--
View this message in context: http://camel.465427.n5.nabble.com/Intercept-HTTP-where-I-use-httpClientConfigurerRef-tp5727569p5727730.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Intercept HTTP where I use httpClientConfigurerRef

Posted by martin11 <ma...@gmail.com>.
The same issue when I tried http4 component.

Any idea?



--
View this message in context: http://camel.465427.n5.nabble.com/Intercept-HTTP-where-I-use-httpClientConfigurerRef-tp5727569p5727664.html
Sent from the Camel - Users mailing list archive at Nabble.com.