JJ created CAMEL-20177:
--------------------------

             Summary: http route returns invalid proxy when none is used
                 Key: CAMEL-20177
                 URL: https://issues.apache.org/jira/browse/CAMEL-20177
             Project: Camel
          Issue Type: Bug
          Components: camel-http
    Affects Versions: 4.0.3
         Environment: EL7
java-latest-openjdk-18.0.2.0.9-1.rolling.el7.x86_64
Camel 4.0.3 Embedded in ActiveMQ 6.0.0

 
            Reporter: JJ


I have a simple {{timer}} route which collects data from a http request. 
However after upgrading to {{camel-4.0.3}} this no longer works, no body is 
fetched and the message is sent to the DLQ. Using {{camel-3.21.1}} it works as 
expected with no errors and the messages body appears on the correct topic for 
consumption.
<route id="solar_pull">
    <from uri="timer:nationalSolar?fixedRate=true&amp;period=300000" />
    <to 
uri="https://api.solar.sheffield.ac.uk/pvlive/api/v4/pes/0?httpClient.cookieSpec=ignoreCookies";
 />
    <to uri="localAMQ:topic:Solar"/>
</route>{{}}
It simply fetches some {{json}} data as shown below;
{{{"data":[[0,"2023-11-27T23:00:00Z",0.0]],"meta":["pes_id","datetime_gmt","generation_mw"]}}}

With Camel 4.0.3 the following strange error is logged in full debug mode;
{{java.lang.IllegalArgumentException: Invalid Proxy}}

{{}}
 
DEBUG | >>>> https://api.solar.sheffield.ac.uk/pvlive/api/v4/pes/0 Exchange[]
DEBUG | ex-0000000001 preparing request execution
DEBUG | ex-0000000001 target auth state: UNCHALLENGED
DEBUG | ex-0000000001 proxy auth state: UNCHALLENGED
DEBUG | ex-0000000001 acquiring connection with route 
\{s}->https://api.solar.sheffield.ac.uk:443
DEBUG | ex-0000000001 acquiring endpoint (3 MINUTES)
DEBUG | ex-0000000001 endpoint lease request (3 MINUTES) [route: 
\{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 0 of 20; total allocated: 0 of 200]
DEBUG | ex-0000000001 endpoint leased [route: 
\{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 1 of 20; total allocated: 1 of 200]
DEBUG | ex-0000000001 acquired ep-0000000001
DEBUG | ex-0000000001 acquired endpoint ep-0000000001
DEBUG | ex-0000000001 opening connection 
\{s}->https://api.solar.sheffield.ac.uk:443
DEBUG | ep-0000000001 connecting endpoint (null)
DEBUG | ep-0000000001 connecting endpoint to 
https://api.solar.sheffield.ac.uk:443 (3 MINUTES)
DEBUG | api.solar.sheffield.ac.uk resolving remote address
DEBUG | api.solar.sheffield.ac.uk resolved to 
[api.solar.sheffield.ac.uk/143.167.1.47]
DEBUG | http-outgoing-0 close connection IMMEDIATE
DEBUG | ep-0000000001 endpoint closed
DEBUG | ep-0000000001 discarding endpoint
DEBUG | ep-0000000001 releasing endpoint
DEBUG | ep-0000000001 connection is not kept alive
DEBUG | ep-0000000001 connection released [route: 
\{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 0 of 20; total allocated: 0 of 200]
DEBUG | Failed delivery for (MessageId: 77E5FE87D16EA50-0000000000000000 on 
ExchangeId: 77E5FE87D16EA50-0000000000000000). On delivery attempt: 0 caught: 
java.lang.IllegalArgumentException: Invalid Proxy{{}}
I've been through the 
[docs|https://camel.apache.org/components/4.0.x/http-component.html] but can't 
see anything obvious as to what's changed. I've also checked the 
[migration|https://camel.apache.org/manual/camel-4-migration-guide.html] doc.

Have I missed or misunderstood something or have I found a bug?
What is the correct way to migrate this route to Camel >4 ?

{{{}{}}}{{{}{}}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to