THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
You can get the HTTP response code from the HTTP4 component by getting the value from the Out message header with HttpProducerExchange.HTTP_RESPONSE_CODE
.
Code Block | ||||
---|---|---|---|---|
| ||||
Exchange exchange = template.send("http4://www.google.com/search", new Processor() { public void process(Exchange exchange) throws Exception { exchange.getIn().setHeader(HttpProducer.QUERY, constant("hl=en&q=activemq")); } }); Message out = exchange.getOut(); int responseCode = out.getHeader(HttpProducerExchange.HTTP_RESPONSE_CODE, Integer.class); |
...