camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henryk Konsek <hekon...@gmail.com>
Subject Re: streaming results using rest dsl
Date Sat, 03 Jan 2015 09:35:35 GMT
Hi Tim,

> Is there a way to stream output using the Rest DSL?

I used the following to download stream of bytes from the REST API:

rest("/api").
        get("/download").bindingMode(RestBindingMode.off).produces('application/octet-stream').route().
        setBody().constant(new ByteArrayOutputStream("foo".getBytes()));.

So I guess that setting OutputStream as the response body should do the trick.

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Mime
View raw message