Reputation: 15
rest()
.get("/{id}")
.produces(MediaType.APPLICATION_JSON_VALUE)
.route()
.setBody(() - > orderService.viewOrder())
.endRest();
I am using apache 2.24.0 version. how to pass id parameter to viewOrder method
Upvotes: 0
Views: 497
Reputation: 1236
The parameters are mapped to message headers with the same name, so in this case you can get the value of the id like:
rest()
.get("/{id}")
.produces(MediaType.APPLICATION_JSON_VALUE)
.route()
.process(e -> {
String id = e.getIn().getHeader("id", String.class);
...
});
Upvotes: 1