Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Replace HttpProducer.HTTP_RESPONSE_CODE with Exchange.HTTP_RESPONSE_CODE

...

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
java
java
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);

...