Restlet Component Connection Keep-Alive
Hi All, We're using the Restlet component to expose some public camel routes and are interested in leveraging the connection: keep-alive feature of http 1.1. However, no matter what we try, the response still includes connection: close and we're wondering what piece is missing. How do we get connection keep-alive to work with the camel-restlet component? Many TIA, --Todd -- View this message in context: http://old.nabble.com/Restlet-Component-Connection-Keep-Alive-tp27537896p27537896.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: CamelContext No Longer Auto-Wires Via Package Element?
Hi Claus, Thanks for your reply. I downloaded and tried with the snapshot dated Tue Jul 07 17:52:26 GMT+00:00 2009. I got no love... :-( The SpringInjector is still attempting to instantiate the route builders using the default constructor instead of auto-wiring using the constructor that takes a CamelContext as a parameter. If I use the previous revision of SpringInjector (revision #752893) things appear OK as that revision calls the createBean(type, autowireMode, dependencyCheck) API vs. simply createBean(type). Perhaps there is another way to get the CamelContextFactoryBean to (subsequently) auto-wire the route builders that I'm not seeing? Thanks, --Todd Claus Ibsen-2 wrote: ... Can you try SNAPSHOT as we have fixed an issue with RouteBuilders not being fully post processed by Spring. See CAMEL-1663. ... -- View this message in context: http://www.nabble.com/CamelContext-No-Longer-Auto-Wires-Via-Package-Element--tp24363086p24382091.html Sent from the Camel - Users mailing list archive at Nabble.com.
CamelContext No Longer Auto-Wires Via Package Element?
We recently upgraded from Camel-M1 to Camel-M2. Using Spring XML to configure the context using the package element, our context looks like: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:camel=http://camel.apache.org/schema/spring; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd; camel:camelContext id=camelContext1 camel:packagecom.xyz.route.impl/camel:package camel:packagecom.xyz.abc.route/camel:package /camel:camelContext ... Our RouteBuilder implementations do not have a default constructor--opting instead to force the context to be auto-wired via SpringInjector. This worked in M1, but does not work in M2--which calls the default constructor. I notice SpringInjector.java was changed for M2 (revision #781314) to remove the auto-wire functionality. Is that because it was redundant? What am I missing in order to have the auto-wire behavior in M2? Thanks much, --Todd -- View this message in context: http://www.nabble.com/CamelContext-No-Longer-Auto-Wires-Via-Package-Element--tp24363086p24363086.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Restlet Component Fault Handling
A proposed change to DefaultRestletBinding is attached. This patch worked great for me, enabling me to set the fault header and exception (without having to also set headers on the out message), and get the expected result in response. http://www.nabble.com/file/p22248469/DefaultRestletBinding.java DefaultRestletBinding.java I simply created a new version of populateRestletResponseFromExchange() which checks the fault before calling populateRestletResponseFromMessage(Message, Response) --which was refactored from the previous populateRestletResponseFromExchange(Exchange, Response). --Todd -- View this message in context: http://www.nabble.com/Restlet-Component-Fault-Handling-tp22173327p22248469.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
Restlet Component Fault Handling
I'm utilizing the Restlet component (via a Trunk build) and am interested in better understanding error handling behavior via the exchange fault message. BTW, I appreciate your work on this component! Good stuff, indeed. In essence, I'm simply using camel-restlet to expose a JSON RESTful service with CRUD behavior. The route looks something like this: from(restlet:http://localhost:8080/people/person/{userId}?restletMethod=GET;) .intercept(new AuthenticationInterceptor()) .process(new QueryStringProcessor()) .process(new GetPersonProcessor()) .marshal(format) .process(new JsonpProcessor()); Of interest for my question is the GetPersonProcessor, which is responsible for retrieving the person object from a storage repository. When a non-existent userId is requested, the GetPersonProcessor does not return a person object and, instead sets the restlet response header to 404 (not found). After reading the Camel manual, I thought it best to set the 404 along with a fault message on the exchange, but the restlet component doesn't appear to acknowledge the fault and composes its response from the out message. So, unless I misunderstand, I have to set the 404 on the out message header (for the restlet component) and set the body on the fault message (for camel to terminate the pipeline). Now for the question: Is this the way I should be doing things? Or could/should the DefaultRestletBinding utilize the fault message to compose its response, if a fault message exists? Your feedback is much appreciated. Thanks, --Todd -- View this message in context: http://www.nabble.com/Restlet-Component-Fault-Handling-tp22173327p22173327.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.