[
https://issues.apache.org/jira/browse/CAMEL-16216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17285742#comment-17285742
]
Claus Ibsen commented on CAMEL-16216:
-------------------------------------
Yes as long you dont have unlimited different socket timeout values, that leads
to a lot of different endpoint uri's.
Just mind that if you connect to the same host and use different timeouts, then
they use each their own http client, as the timeout is client specific.
> Dynamic Endpoint with Http-Component not working
> ------------------------------------------------
>
> Key: CAMEL-16216
> URL: https://issues.apache.org/jira/browse/CAMEL-16216
> Project: Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 3.6.0, 3.7.0, 3.7.2, 3.8.0
> Reporter: Josef Tember
> Priority: Minor
>
> I created a ticket: reffering to
> http://mail-archives.apache.org/mod_mbox/camel-users/202102.mbox/%3CCAGB5yN%3Dv0PZSTEPvEO0O6i2CRZMO1YiF4X9e%3DwNZsmLROJYiTQ%40mail.gmail.com%3E
>
> Also tried it with Version 3.6.0, 3.7.0, 3.7.2, 3.8.0
> I'm trying to make an http-call with dynamic timeout, passed by header
> {code:java}
> Map<String,Object> headerMap=new HashMap<>();
> headerMap.put(Exchange.HTTP_URI, "http://myserver.example.com");
> headerMap.put("timeout", 5000);
> main.getCamelTemplate().sendBodyAndHeaders("direct:test_http_dynamic",null,headerMap);{code}
> the endpoint looks like this:
>
> {code:java}
> from("direct:test_http_dynamic")
> .toD("http:test.dyn?socketTimeout=${in.header.timeout}");{code}
> This leads to this Stacktrace:
> {code:java}
> org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint:
> http://http:test.dyn
> due to: Failed to resolve endpoint: http://http:test.dyn due to: The uri part
> is not configured
> correctly. You have duplicated the http(s) protocol.
> at
> org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:912)
> ~[camel-base-engine-3.7.0.jar:3.7.0]
> at
> org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:798)
> ~[camel-base-engine-3.7.0.jar:3.7.0]
> at
> org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:73)
> ~[camel-support-3.7.0.jar:3.7.0]
> at
> org.apache.camel.support.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:112)
> ~[camel-support-3.7.0.jar:3.7.0]{code}
>
> === Possible Workaround:
> change RouteDefinition to - turning off optimizer:
>
> {code:java}
> from("direct:test_http_dynamic_workaround")
> .toD().allowOptimisedComponents(false).cacheSize(10).uri("http:test.dyn?socketTimeout=${in.header.timeout}");
> {code}
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)