I using camel reactive streams and I would like to add content type APPLICATION_JSON_UTF8_VALUE
for the response. I tried to add it in map function. Here is my code.
@Autowired
private CamelReactiveStreamsService camel;
camel.process("rest:post:test", exchangeProperty ->
Flux.from(exchangeProperty)
.map(ex -> {
ex.getIn().setHeader(Exchange.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE);
return ex;
})
.map(ex -> ex.getIn().getBody(String.class))
.flatMap(camel.toStream("testRest", String.class))
.doOnNext(ex -> System.out.println(ex)));
This code returns only text without Header "content type" I think I don't understand how it works, so will be nice if someone can send me a link with tutorial(because I can't find), or someone can help me understand it. Thank you for help