Created
July 9, 2018 15:50
-
-
Save olegchir/951aa59305e158f019017be9316b8eba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rest("/api/") | |
.id("api-route") | |
.consumes("application/json") | |
.post("/bean") | |
.bindingMode(RestBindingMode.json_xml) | |
.type(MyBean.class) | |
.to("direct:remoteService"); | |
//... | |
from("direct:remoteService") | |
.routeId("direct-route") | |
.tracing() | |
.log(">>> ${body.id}") | |
.log(">>> ${body.name}") | |
.process(new Processor() { | |
@Override | |
public void process(Exchange exchange) throws Exception { | |
MyBean bodyIn = (MyBean) exchange.getIn().getBody(); | |
ExampleServices.example(bodyIn); | |
exchange.getIn().setBody(bodyIn); | |
} | |
}) | |
.setHeader(Exchange.HTTP_RESPONSE_CODE, constant(200)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment