import org.apache.camel.builder.RouteBuilder;
public class CamelRoute extends RouteBuilder {
@Override
public void configure() {
rest("/api")
// Dash '-' is not allowed by default
.get("/dashed/param/{my-param}")
.route()
.setBody(constant("Hello World"))
.endRest()
// The non-dashed path parameter works by default
.get("/undashed/param/{myParam}")
.route()
.setBody(constant("Hello World"))
.endRest();
}
}
import org.apache.camel.builder.RouteBuilder;
public class CamelRoute extends RouteBuilder {
@Override
public void configure() {
rest("/api")
// Dash '-' is not allowed by default
.get("/dashed/param/{my-param}")
.route()
.setBody(constant("Hello World"))
.endRest()
// The non-dashed path parameter works by default
.get("/undashed/param/{myParam}")
.route()
.setBody(constant("Hello World"))
.endRest();
}
}
Copy to ClipboardCopied!Toggle word wrapToggle overflow