I'm trying to use the Apache Camel REST DSL to create a simple REST API that just is supposed to return a String when called.
However, while the code below was once working, the API seems to have changed
rest().get("/hello-world").produces(MediaType.APPLICATION_JSON_VALUE).route()
.setBody(constant("Welcome to apache camel test ")).endRest();
route() does not exist anymore in Apache Camel 3.17.0
I've also tried
rest("/say")
.get("/hello")
.responseMessage(200, "Hello World");
But this returns an empty String instead of "Hello World"
The only thing that worked so far is by creating an extra route
rest("/say")
.get("/hello")
.to("direct:build-return-message");
from("direct:build-return-message")
.setBody(simple("Hello World"));
But this can't be the preferred way.
How would you now set the response body with the latest API?

Something like this maybe ?