[ 
https://issues.apache.org/jira/browse/CAMEL-16216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17285739#comment-17285739
 ] 

Josef Tember commented on CAMEL-16216:
--------------------------------------

Thank your for your quick answer.

I don't contact the same host with different timeouts - i contact different 
hosts/URIs with different timeouts depending what product they create.

The Number of hosts/URIs are final - about 20 of them. And each of them has a 
different, but static timeout .

 

I understand, that the optimizer may not build for this scenario.

But is it ok to turn off the optimizer for my purpose?

 

 

 

> 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)

Reply via email to