首页 > 解决方案 > 在骆驼3中正确设置http套接字超时

问题描述

拥有这个 Spring-XML 配置

<to uri="http://localhost:8088/?httpMethod=GET&amp;bridgeEndpoint=true&amp;socketTimeout=10000&amp;throwExceptionOnFailure=false"/>

socketTimeout is a custom option that is not part of the Camel component在 IntelliJ IDEA 中收到警告。
事实上,在骆驼文档中,我在组件选项中看到了 socketTimeout,上面代码片段中的其他选项在查询参数中,所以问题是是否应该以不同的方式指定 socketTimeout?正确的方法是什么?
提前致谢

标签: spring-boothttpapache-camelapache-camel-3

解决方案


它被定义为组件选项,因此不能从端点 uri 使用。如果您使用的是 spring,则可以执行类似https://camel.apache.org/manual/latest/configuring-camel.html#ConfiguringCamel-WorkingwithSpringXML之类的操作来配置组件的超时。


推荐阅读