// Provider role
if (exchange.getRole() == Role.PROVIDER) {
processInputRequest(exchange);
// Consumer role
} else {
ServiceEndpoint ep = exchange.getEndpoint();
// Credit agency response
if (ep.getServiceName().getLocalPart().equals(Constants.CREDITAGENCY_SERVICE)) {
processCreditAgencyResponse(exchange);
} else if (ep.getServiceName().getLocalPart().equals(Constants.LENDERGATEWAY_SERVICE)) {
processLenderGatewayResponse(exchange);
} else {
processLoanQuote(exchange);
}
}