camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: REST DSL - including documents
Date Tue, 27 Jan 2015 07:10:11 GMT
Hi

Yeah it would be a nice addition to camel-netty4-http to have an out
of the box handler that can service static files from the classpath.

PS: You may want to use camel-netty4-http as it uses the newer Netty 4.x.

Keep up the good work

On Sun, Jan 25, 2015 at 9:48 AM, Taariq Levack <taariql@gmail.com> wrote:
> Hi guys
>
> I just did the same thing for Netty and I used Netty's example code for
> serving static files, just Camelized it a little in a fabric8 quickstart
> using Rest DSL.
> With this I can have the REST routes and the static files served on the
> same port, support browser caching etc.
>
> There are still a few todos like fixing the ports for fabric8, and I would
> have liked to register a handler instead, maybe injecting it into the
> serverPipelineFactory.
> For now it's a router that shares the Netty bootstrap configuration with
> the REST routes, and a processor to do the file handling.
> Or what would you suggest Claus?
> I'll remove the file handling stuff before sending a PR to keep the
> quickstart simple, or do a new REST DSL quickstart using something else.
>
> Here's the branch;
> https://github.com/levackt/quickstarts/tree/Camel_REST_DSL/quickstarts/java/netty-http-restdsl
>
>
> Taariq
>
> On Fri, Jan 23, 2015 at 7:25 PM, Tim Dudgeon <tdudgeon.ml@gmail.com> wrote:
>
>> Thanks, That's an interesting example.
>> I'll take a look over it.
>> In the meantime I kept bashing away at doing it the Jetty way, but don't
>> quite have it working. I created this gist to try to illustrate it:
>> https://gist.github.com/tdudgeon/2f242578fd0742e713a7
>> (note I backed away slightly from what Claus suggested and and tried doing
>> direct on the jetty endpoint as that seemed simpler).
>>
>> Everything runs, the jetty and rest routes work fine, but the static
>> content stubbornly refuses to serve.
>> The only thing suspicious that I see reported is this:
>> [main] INFO org.eclipse.jetty.server.handler.ContextHandler - stopped
>> o.e.j.s.ServletContextHandler{/,null}
>>
>> Anyone got any thoughts?
>>
>> Tim
>>
>>
>>
>> On 23/01/2015 15:54, scottdawson wrote:
>>
>>> Hello,
>>> Here's the  JIRA ticket <https://issues.apache.org/jira/browse/CAMEL-7381
>>> >
>>> Claus referred to. It appears to be "stalled".
>>>
>>> In the meantime you might want to use the code that the new feature is
>>> based
>>> on, written by Tracy Snell and documented  here
>>> <http://code.notsoclever.cc/writing-camel-component-camel-
>>> static-resource/>
>>> .
>>>
>>> Regards,
>>> Scott
>>>
>>>
>>>
>>> --
>>> View this message in context: http://camel.465427.n5.nabble.
>>> com/REST-DSL-including-documents-tp5762034p5762064.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message