简体   繁体   English

Apache Camel HTTP 超时

[英]Apache Camel HTTP Timeout

I am using Apache Camel route for HTTP call.我正在使用 Apache Camel 路由进行 HTTP 调用。 I wanted to add timeout if there is delay from host system.如果主机系统有延迟,我想添加超时。 I am using the following configuration but it is not working.我正在使用以下配置,但它不起作用。 The client request is getting timeout without waiting host system timeout.客户端请求超时而不等待主机系统超时。 The client timeout is configured in CXF but the camel timeout is configured in camel route.客户端超时在 CXF 中配置,但骆驼超时在骆驼路由中配置。 It should timeout in 4 second and it should go to error processor and but it is not happening.它应该在 4 秒内超时,并且应该转到错误处理器,但它没有发生。

HTTP HTTP

<setHeader headerName="CamelHttpQuery">
    <constant>httpclient.soTimeout=4000&amp;bridgeEndpoint=true&throwExceptionOnFailure=false</constant>
<setHeader>

HTTP4 HTTP4

<setHeader headerName="CamelHttpQuery"><constant>httpclient.socketTimout=4000&amp;bridgeEndpoint=true&throwExceptionOnFailure=false</constant>
<setHeader>

Thanks谢谢

Please be attentive for syntax.请注意语法。 Correct spelling正确拼写

httpClient.socketTimeout=4000&amp;bridgeEndpoint=true&amp;throwExceptionOnFailure=false

But even after correcting parameters it will not work.但即使在更正参数后它也不起作用。 Instead of configuring http endpoint you send your parameters as query string of request to server.您将参数作为请求的查询字符串发送到服务器,而不是配置 http 端点。 For set up endpoint just add your parameters to it and use CamelHttpQuery header for request parameters.对于设置端点,只需将您的参数添加到它并使用 CamelHttpQuery 标头作为请求参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM