Hi Willem,

unfortunately I was not able to get this working. I saw the unit test that
you checked in for this. The test runs without an error. However, it does
not verify this completely. Although it is now possible to get the stream,
the stream has been read. I changed the route builder used in the test to
this:

               
from("jetty:http://localhost:9083/noStreamCache?disableStreamCache=true";).noStreamCaching().process(new
Processor() {

                    public void process(Exchange exchange) throws Exception
{
                        InputStream is =
(InputStream)exchange.getIn().getBody();
                        assertTrue(is.read() != -1);
                        System.out.println(is.getClass());
                        assertTrue("It should be a raw inputstream", is
instanceof org.eclipse.jetty.server.HttpInput);
                        exchange.getOut().setBody("OK");
                    }
                    
                });

And then the check for "is.read() != -1" fails. The reason for this is
within DefaultHttpBinding.readRequest:

        // reset the stream cache
        StreamCache cache = message.getBody(StreamCache.class);

This reads the actual input stream into a CachedInputStream, no matter what
settings are disabled.

Jens



willem.jiang wrote:
> 
> Just FYI,
> 
> I introduced a disableStreamCache option into HttpComponent[1], by 
> setting this option to be true, you will get the pure input stream that 
> Jetty provides.
> 
> [1] https://issues.apache.org/activemq/browse/CAMEL-2738
> 
> 
> Willem
> 
> 

-- 
View this message in context: 
http://old.nabble.com/2.3-SNAPSHOT%3A-Stream-Caching-again-enabled-by-Bug-Fix-for-Camel-2686-and-CAMEL-2694-%28rev-941275%29--tp28582952p28619827.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to