3

我正在使用 Camel Restlet 进行一般路由,响应时间为 300 毫秒,是否有任何设置可以减少响应时间。

我的路由配置

 <route id="retriveEntry">
                <from uri="restlet:/user/{cachename}/{userId}?restletMethod=GET"/>
                <setHeader headerName="Content-Type">
                  <constant>application/xml</constant>
                </setHeader>
                <!-- <process ref="requestTimeProc"/> -->
                <to uri="restlet:http://hostname:8180/rest/{cachename}/{userId}?restletMethod=GET"/>
                <!-- <process ref="responseTimeProc"/> -->
            </route>

Response time By hitting the backend URL directly is :40 ms http://hostname:8180/rest/{cachename}/{userId}

我还在我的骆驼日志中看到了这些警告,不知道为什么:

WARNING: Addition of the standard header "Content-Length" is not allowed. Please use the equivalent property in the Restlet API.
Nov 13, 2013 5:07:38 PM org.restlet.engine.http.header.HeaderUtils addExtensionHeaders
WARNING: Addition of the standard header "Date" is not allowed. Please use the equivalent property in the Restlet API.
Nov 13, 2013 5:07:39 PM org.restlet.engine.http.header.HeaderUtils addExtensionHeaders
WARNING: Addition of the standard header "Host" is not allowed. Please use the equivalent property in the Restlet API.
Nov 13, 2013 5:07:39 PM org.restlet.engine.http.header.HeaderUtils addExtensionHeaders
WARNING: Addition of the standard header "Connection" is not allowed. Please use the equivalent property in the Restlet API.
Nov 13, 2013 5:07:39 PM org.restlet.engine.http.header.HeaderUtils addExtensionHeaders
WARNING: Addition of the standard header "User-Agent" is not allowed. Please use the equivalent property in the Restlet API.
Nov 13, 2013 5:07:39 PM org.restlet.engine.http.header.HeaderUtils addExtensionHeaders
4

1 回答 1

2

由于您只是将请求路由到后端服务,因此您不需要使用 camel-rest 来完成此类工作。您可以使用 camel-jetty 和 camel-http 来定义这样的路线

<route>
    <from uri="jetty:xxx"/>
    <to uri="http://xxx"/>
</route>

对于 WARNING 消息,它应该在CAMEL-6590中解决

于 2013-11-14T08:13:42.137 回答