149.15. 응답 코드 가져오기

Exchange.HTTP_RESPONSE_CODE 와 함께 Out message 헤더에서 값을 가져와 HTTP 구성 요소로부터 HTTP 응답 코드를 가져올 수 있습니다.

   Exchange exchange = template.send("http://www.google.com/search", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(Exchange.HTTP_QUERY, constant("hl=en&q=activemq"));
            }
   });
   Message out = exchange.getOut();
   int responseCode = out.getHeader(Exchange.HTTP_RESPONSE_CODE, Integer.class);