public void process(Exchange exchange) throws Exception { Integer pullRequestNumber = exchange.getIn().getHeader(GitHubConstants.GITHUB_PULLREQUEST, Integer.class); PullRequest pullRequest = pullRequestService.getPullRequest(getRepository(), pullRequestNumber); pullRequest.setState("closed"); pullRequest.setClosedAt(Calendar.getInstance().getTime()); pullRequest = pullRequestService.editPullRequest(getRepository(), pullRequest); // support InOut if (exchange.getPattern().isOutCapable()) { // copy the header of in message to the out message exchange.getOut().copyFrom(exchange.getIn()); exchange.getOut().setBody(pullRequest); } }