Thanks again! I tried that and a few different combinations and no success.
When I turned camel trace level on I saw Facebook returning a redirect so I
switched to a website that responds to a plain 'curl' command. My complete
simple example is below and pretty much straight off camel website.
When I debug JettyHttpProducer has no reference to the input path at all, only
the uri portion..
Has anyone got this working (recently) ?
package net;
import org.apache.camel.*;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import java.util.Map;
public class Routes extends RouteBuilder {
public void configure() throws Exception {
this.from("jetty:http://0.0.0.0:8081/proxy?matchOnUriPrefix=true")
.process(new CustomProcessor())
.to("jetty:http://www.wotif.com?bridgeEndpoint=true&throwExceptionOnFailure=false");
}
private static final class CustomProcessor implements Processor {
public void process(Exchange exchange) throws Exception {
Message in = exchange.getIn();
for (Map.Entry<String, Object> header : in.getHeaders().entrySet())
{
final String value = header.getValue() == null ? "null" :
header.getValue().toString();
System.out.println("IN Header " + header.getKey() + " : " +
value);
}
}
}
public static void main(String args[]) throws Exception {
CamelContext camel = new DefaultCamelContext();
Routes routes = new Routes();
camel.addRoutes(routes);
camel.start();
}
}
IN Header Cache-Control : max-age=0
IN Header CamelHttpServletResponse : HTTP/1.1 200
IN Header Accept :
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
IN Header CamelHttpMethod : GET
IN Header User-Agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2)
AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11
IN Header Connection : keep-alive
IN Header Content-Type : null
IN Header CamelHttpUri : /proxy/info/contact-us
IN Header Accept-Language : en-US,en;q=0.8
IN Header Cookie : c_m=undefinedDirect%20LoadDirect%20Load;
s.eVar70=%5B%5B'Direct%2520Load'%2C'1354158528915'%5D%5D; s_cc=true; s_sv_p1=1;
s_sq=%5B%5BB%5D%5D
IN Header Accept-Encoding : gzip,deflate,sdch
IN Header breadcrumbId : ID-iMac-01-local-49577-1354159831401-0-2
IN Header CamelHttpPath : /proxy/info/contact-us
IN Header CamelHttpQuery : null
IN Header CamelHttpUrl : http://localhost:8081/proxy/info/contact-us
IN Header CamelHttpServletRequest : (GET /proxy/info/contact-us)@42687583
org.eclipse.jetty.server.Request@28b5c5f
IN Header Accept-Charset : ISO-8859-1,utf-8;q=0.7,*;q=0.3
IN Header Host : localhost:8081
..
2012-11-29 13:30:40,265 [tp1195868420-23] TRACE DefaultErrorHandler
- Is exchangeId: ID-iMac-01-local-49577-1354159831401-0-1 interrupted? false
2012-11-29 13:30:40,266 [tp1195868420-23] TRACE DefaultErrorHandler
- Is exchangeId: ID-iMac-01-local-49577-1354159831401-0-1 done? true
2012-11-29 13:30:40,266 [tp1195868420-23] TRACE AsyncProcessorHelper
- Exchange processed and is continued routed synchronously for exchangeId:
ID-iMac-01-local-49577-1354159831401-0-1 -> Exchange[Message: [Body is null]]
2012-11-29 13:30:40,266 [tp1195868420-23] TRACE Pipeline
- Processing exchangeId: ID-iMac-01-local-49577-1354159831401-0-1 is continued
being processed synchronously
2012-11-29 13:30:40,266 [tp1195868420-23] TRACE Pipeline
- ExchangeId: ID-iMac-01-local-49577-1354159831401-0-1 should continue routing:
true
2012-11-29 13:30:40,266 [tp1195868420-23] TRACE Pipeline
- Processing exchangeId: ID-iMac-01-local-49577-1354159831401-0-1 >>>
Exchange[Message: [Body is null]]
2012-11-29 13:30:40,267 [tp1195868420-23] DEBUG SendProcessor
- >>>>
Endpoint[http://www.wotif.com?throwExceptionOnFailure=false&bridgeEndpoint=true]
Exchange[Message: [Body is null]]
2012-11-29 13:30:40,288 [tp1195868420-23] TRACE JettyHttpProducer
- Using URL: http://www.wotif.com with method: GET
2012-11-29 13:30:40,291 [tp1195868420-23] DEBUG JettyHttpProducer
- Sending HTTP request to: http//www.wotif.com:80/
On 29/11/2012, at 4:12 AM, lleclerc <[email protected]> wrote:
> remove the www.
> just use http://facebook.com
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Simple-HTTP-proxy-tp5723322p5723368.html
> Sent from the Camel - Users mailing list archive at Nabble.com.