use of org.apache.camel.component.http.HttpEndpoint in project camel by apache.
the class HttpHelperTest method createHttpEndpoint.
private HttpEndpoint createHttpEndpoint(boolean bridgeEndpoint, String endpointURI) throws URISyntaxException {
HttpEndpoint endpoint = new HttpEndpoint();
endpoint.setBridgeEndpoint(bridgeEndpoint);
if (endpointURI != null) {
endpoint.setHttpUri(new URI(endpointURI));
}
return endpoint;
}
use of org.apache.camel.component.http.HttpEndpoint in project camel by apache.
the class HttpMethodsHelperTest method createHttpEndpoint.
private HttpEndpoint createHttpEndpoint(boolean bridgeEndpoint, String endpointURI) throws URISyntaxException {
HttpEndpoint endpoint = new HttpEndpoint();
endpoint.setBridgeEndpoint(bridgeEndpoint);
if (endpointURI != null) {
endpoint.setHttpUri(new URI(endpointURI));
}
return endpoint;
}
use of org.apache.camel.component.http.HttpEndpoint in project camel by apache.
the class HttpBridgeMultipartRouteTest method createRouteBuilder.
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
port1 = getPort();
port2 = getNextPort();
errorHandler(noErrorHandler());
Processor serviceProc = new Processor() {
public void process(Exchange exchange) throws Exception {
Message in = exchange.getIn();
// put the number of attachments in a response header
exchange.getOut().setHeader("numAttachments", in.getAttachments().size());
exchange.getOut().setBody(in.getHeader("body"));
}
};
HttpEndpoint epOut = getContext().getEndpoint("http://localhost:" + port1 + "?bridgeEndpoint=true&throwExceptionOnFailure=false", HttpEndpoint.class);
epOut.setHeaderFilterStrategy(new MultipartHeaderFilterStrategy());
from("jetty:http://localhost:" + port2 + "/test/hello?enableMultipartFilter=false").to(epOut);
from("jetty://http://localhost:" + port1 + "?matchOnUriPrefix=true").process(serviceProc);
}
};
}
Aggregations