from("jetty:http://localhost:" + port1 + "/test").process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
HttpMessage message = (HttpMessage)exchange.getIn();
assertNotNull(message.getRequest());
assertEquals("GET", message.getRequest().getMethod());
exchange.getOut().setBody(message.getRequest().getQueryString());
}
});
from("jetty:http://localhost:" + port2 + "/test").process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
HttpMessage message = (HttpMessage)exchange.getIn();
assertNotNull(message.getRequest());
assertEquals("GET", message.getRequest().getMethod());
exchange.getOut().setBody(message.getRequest().getQueryString() + "&2");
}
});
from("direct:start1").to("http4://localhost:" + port1 + "/test");