You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nicolas Filotto (Jira)" <ji...@apache.org> on 2023/09/12 13:37:00 UTC
[jira] [Assigned] (CAMEL-19851) spring-boot Allow to configure timeouts natively
[ https://issues.apache.org/jira/browse/CAMEL-19851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicolas Filotto reassigned CAMEL-19851:
---------------------------------------
Assignee: Nicolas Filotto
> spring-boot Allow to configure timeouts natively
> ------------------------------------------------
>
> Key: CAMEL-19851
> URL: https://issues.apache.org/jira/browse/CAMEL-19851
> Project: Camel
> Issue Type: Improvement
> Components: camel-http
> Affects Versions: 4.x
> Environment:
>
> Reporter: Valeriy Ak
> Assignee: Nicolas Filotto
> Priority: Major
>
> In http component we have some properties with type org.apache.hc.core5.util.Timeout:
> * camel.component.http.connect-timeout
> * camel.component.http.connection-request-timeout
> * camel.component.http.response-timeout
> * camel.component.http.so-timeout
> We can set this properies by spring boot prop file ([documentation|https://camel.apache.org/components/4.0.x/http-component.html#_spring_boot_auto_configuration]).
>
> However in current realization it is not posible to set thouse values because converter don't create Timeout object, it try to get bean with this name from spring context [HttpComponentConverter|https://github.com/apache/camel-spring-boot/blob/camel-spring-boot-4.0.x/components-starter/camel-http-starter/src/main/java/org/apache/camel/component/http/springboot/HttpComponentConverter.java#L77] , if bean not present it alwayes return null value (withou any excaptions or warrnigs(!))
>
> It is not correct behavior - and correct way is convert value to [Duration |https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config.typesafe-configuration-properties.conversion.durations]and then call Timeout.of(duration)
>
> Please fix converter for org.apache.hc.core5.util.Timeout class
>
> Examples:
> {code:java}
> camel:
> component:
> http:
> so-timeout: PT30S
> ---
> bean HttpComponentConfiguration.soTimeout=null
> camel:
> component:
> http:
> so-timeout: 1000
> ---
> Exception on start - Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.Integer] to type [org.apache.hc.core5.util.Timeout]{code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)