Examples of InputStreamCache


Examples of org.apache.camel.converter.stream.InputStreamCache

                    public void process(Exchange exchange) throws Exception {
                        Message out = exchange.getOut();
                        out.copyFrom(exchange.getIn());
                        log.info("The body's object is " + exchange.getIn().getBody());
                        log.info("Process body = " + exchange.getIn().getBody(String.class));
                        InputStreamCache cache = out.getBody(InputStreamCache.class);
                        cache.reset();
                    }
                };
                from("jetty:http://localhost:9280/hello?sessionSupport=true").process(proc);

                from("jetty:http://localhost:9280/echo").process(printProcessor).process(printProcessor);
View Full Code Here

Examples of org.apache.camel.converter.stream.InputStreamCache

                    public void process(Exchange exchange) throws Exception {
                        Message out = exchange.getOut();
                        out.copyFrom(exchange.getIn());
                        log.info("The body's object is " + exchange.getIn().getBody());
                        log.info("Process body = " + exchange.getIn().getBody(String.class));
                        InputStreamCache cache = out.getBody(InputStreamCache.class);
                        cache.reset();
                    }              
                };
                from("jetty:http://localhost:9080/hello?sessionSupport=true").process(proc);
               
                from("jetty:http://localhost:9080/echo").process(printProcessor).process(printProcessor);
View Full Code Here

Examples of org.apache.camel.converter.stream.InputStreamCache

                    public void process(Exchange exchange) throws Exception {
                        Message out = exchange.getOut();
                        out.copyFrom(exchange.getIn());
                        log.info("The body's object is " + exchange.getIn().getBody());
                        log.info("Process body = " + exchange.getIn().getBody(String.class));
                        InputStreamCache cache = out.getBody(InputStreamCache.class);
                        cache.reset();
                    }              
                };
                from("jetty:http://localhost:9080/hello?sessionSupport=true").process(proc);
               
                from("jetty:http://localhost:9080/echo").process(printProcessor).process(printProcessor);
View Full Code Here

Examples of org.apache.camel.converter.stream.InputStreamCache

                    public void process(Exchange exchange) throws Exception {
                        Message out = exchange.getOut();
                        out.copyFrom(exchange.getIn());
                        log.info("The body's object is " + exchange.getIn().getBody());
                        log.info("Process body = " + exchange.getIn().getBody(String.class));
                        InputStreamCache cache = out.getBody(InputStreamCache.class);
                        cache.reset();
                    }
                };
                from("jetty:http://localhost:" + port2 + "/hello?sessionSupport=true").process(proc);

                from("jetty:http://localhost:" + port1 + "/echo").process(printProcessor).process(printProcessor);
View Full Code Here

Examples of org.apache.camel.converter.stream.InputStreamCache

                    public void process(Exchange exchange) throws Exception {
                        Message out = exchange.getOut();
                        out.copyFrom(exchange.getIn());
                        log.info("The body's object is " + exchange.getIn().getBody());
                        log.info("Process body = " + exchange.getIn().getBody(String.class));
                        InputStreamCache cache = out.getBody(InputStreamCache.class);
                        cache.reset();
                    }              
                };
                from("jetty:http://localhost:9080/hello?sessionSupport=true").process(proc);
               
                from("jetty:http://localhost:9080/echo").process(printProcessor).process(printProcessor);
View Full Code Here

Examples of org.apache.camel.converter.stream.InputStreamCache

                    public void process(Exchange exchange) throws Exception {
                        Message out = exchange.getOut();
                        out.copyFrom(exchange.getIn());
                        log.info("The body's object is " + exchange.getIn().getBody());
                        log.info("Process body = " + exchange.getIn().getBody(String.class));
                        InputStreamCache cache = out.getBody(InputStreamCache.class);
                        cache.reset();
                    }
                };
                from("jetty:http://localhost:" + port2 + "/hello?sessionSupport=true").process(proc);

                from("jetty:http://localhost:" + port1 + "/echo").process(printProcessor).process(printProcessor);
View Full Code Here

Examples of org.apache.camel.converter.stream.InputStreamCache

        getMockEndpoint("mock:middle").expectedMessageCount(1);
        getMockEndpoint("mock:middle").message(0).property(Exchange.EXCEPTION_CAUGHT).isInstanceOf(IllegalArgumentException.class);
        getMockEndpoint("mock:end").expectedMessageCount(1);
        getMockEndpoint("mock:end").message(0).property(Exchange.EXCEPTION_CAUGHT).isInstanceOf(IllegalArgumentException.class);
   
        InputStreamCache cache = new InputStreamCache(TEST_STRING.getBytes());
       
        template.sendBody("direct:a", cache);

        assertMockEndpointsSatisfied();
       
View Full Code Here

Examples of org.apache.camel.converter.stream.InputStreamCache

        getMockEndpoint("mock:middle").expectedMessageCount(1);
        getMockEndpoint("mock:middle").message(0).property(Exchange.EXCEPTION_CAUGHT).isInstanceOf(IllegalArgumentException.class);
        getMockEndpoint("mock:end").expectedMessageCount(1);
        getMockEndpoint("mock:end").message(0).property(Exchange.EXCEPTION_CAUGHT).isInstanceOf(IllegalArgumentException.class);
   
        InputStreamCache cache = new InputStreamCache(TEST_STRING.getBytes());
       
        template.sendBody("direct:a", cache);

        assertMockEndpointsSatisfied();
       
View Full Code Here

Examples of org.apache.camel.converter.stream.InputStreamCache

                    public void process(Exchange exchange) throws Exception {
                        Message out = exchange.getOut();
                        out.copyFrom(exchange.getIn());
                        log.info("The body's object is " + exchange.getIn().getBody());
                        log.info("Process body = " + exchange.getIn().getBody(String.class));
                        InputStreamCache cache = out.getBody(InputStreamCache.class);
                        cache.reset();
                    }
                };
                from("jetty:http://localhost:" + port2 + "/hello?sessionSupport=true").process(proc);

                from("jetty:http://localhost:" + port1 + "/echo").process(printProcessor).process(printProcessor);
View Full Code Here

Examples of org.apache.camel.converter.stream.InputStreamCache

      message("test1" , createMap("A", "1")).withHeaders(createMap("C", "3")));
  }

  @Test
  public void shouldBeAbleToReReadStreamCacheBody() throws Exception {
    CamelMessage msg = new CamelMessage(new InputStreamCache("test1".getBytes("utf-8")), empty);
    assertEquals("test1", msg.getBodyAs(String.class, camel.context()));
    // re-read
    assertEquals("test1", msg.getBodyAs(String.class, camel.context()));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.