camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <christian.muel...@gmail.com>
Subject Re: Using HTTP and HTTPS proxies with Camel HTTP Component
Date Tue, 10 Sep 2013 19:49:11 GMT
Did you tried setting the proxy host/port as we described here [1]?

[1] http://camel.apache.org/http.html

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Thu, Sep 5, 2013 at 1:41 PM, Alex Anderson <
alexanderandersonofandover@gmail.com> wrote:

> I'm writing some test code which uses and HTTP/HTTPS proxy to mock 3rd
> party webservices.
>
> For non-camel code, I configure the proxy using the java system properties:
> http.proxyHost, http.proxyPort, https.proxyHost, https.proxyPort,
> http.nonProxyHosts.
>
> These settings seem to be ignored by camel, so I have also explicitly
> set the HTTP proxy in camelContext (code is groovy):
>
>     camelContext.properties['http.proxyHost'] =
> System.properties['http.proxyHost']
>     camelContext.properties['http.proxyPort'] =
> System.properties['http.proxyPort']
>
> These settings work fine *for HTTP*.  However, I can't find
> documentation for getting HTTPS working.
>
> I've tried setting other properties on the camel context, such as
> https.proxyPort, http.proxyScheme, http.proxyAuthSceme,
> https.proxyScheme, https.proxyAuthScheme to no avail (although I've
> seen a couple of different exceptions).
>
> I'd be happy to document my findings, but thought I should first check:
>
> * is this a known issue?
> * has it been fixed in later version of camel? (I'm using 2.9.4)
> * should I expect to be able to proxy both HTTP and HTTPS to either
> different or the same ports using Camel without reconfiguring in
> between requests?
>
> Thanks for any help,
>
> Alex
>
>
> For interest, most common exception I got:
>
>     ## 05 Sep 2013 13:49:32,931 ## seda.SedaConsumer Error processing
> exchange. Exchange[Message: test]. Caused by: [java.io.IOException -
> Stream closed]
>     java.io.IOException: Stream closed
>         at
> java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:151)
>         at
> java.io.BufferedInputStream.available(BufferedInputStream.java:398)
>         at
> org.apache.commons.httpclient.ContentLengthInputStream.available(ContentLengthInputStream.java:213)
>         ...
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message