Spring boot Apache camel integration part 4

preview_player
Показать описание
Testing Spring boot Apache camel application using postman.
Modifying process workflow by adding choice when otherwise statement.
Testing a routing endpoint
context path
rest("/api/").description("Teste REST Service")
.id("api-route")
.post("/bean")
.produces(MediaType.APPLICATION_JSON)
.consumes(MediaType.APPLICATION_JSON)
// .get("/hello/place")
.enableCORS(true)

.to("direct:remoteService");

.when(body().contains("hello")).setBody(simple("hello world"))
.otherwise()
.process(new Processor()
@Override
public void process(Exchange exchange) throws Exception
.getBody();

.setBody(bodyIn);

.setHeader(Exchange.HTTP_RESPONSE_CODE, constant(201));
Рекомендации по теме
Комментарии
Автор

Hola, puedes dejar el proyecto completo para verlo mejor

carlosmichaellmedinahuaman