public void process(Exchange exchange) throws Exception { String pullRequestNumberSHA = exchange.getIn().getHeader(GitHubConstants.GITHUB_PULLREQUEST_HEAD_COMMIT_SHA, String.class); String text = exchange.getIn().getBody(String.class); CommitStatus status = new CommitStatus(); if (state != null) { status.setState(state); } if (targetUrl != null) { status.setTargetUrl(targetUrl); } if (text != null) { status.setDescription(text); } CommitStatus response = commitService.createStatus(getRepository(), pullRequestNumberSHA, status); // copy the header of in message to the out message exchange.getOut().copyFrom(exchange.getIn()); exchange.getOut().setBody(response); }