Question

I am doing general routing using Camel Restlet and the response time is 300ms is there any setting i can do to reduce the response time.

My Routing configuration

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

I also see these warning's in my camel log not sure why:

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
Was it helpful?

Solution

As you just route the request to the back end service, you don't need to use camel-rest to do that kind of work. You can use camel-jetty and camel-http to define the route like this

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

For the WARNING message, it should be resolve in CAMEL-6590

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top