如何在没有Spring Boot的情况下在Apache Camel中使用rest()

问题描述 投票:0回答:1

我不能使用Spring-Boot!我创建一个Rest Service,如:

from("restlet:http://0.0.0.0:8055/test?restletMethod=get")
    .process(new Processor() {
        public void process(Exchange exchange) throws Exception {
            exchange.getOut().setBody("Test Back");
        }
    }

这项工作。但是,如果我有更多的路线,我认为这将非常令人困惑。我找到了此代码:

rest("/test")
    .get("/test1").to("direct:getValueTest1")
    .get("/test2/{id}").to("direct:getDetailsTest2");

但是我没有开始。没有Spring Boot怎么办?有任何想法吗?

谢谢

java rest apache-camel
1个回答
0
投票

[第一个代码块参考restlet component,第二个代码块参考rest dsl component。对于rest dsl component,使用时可能需要定义restConfiguration

© www.soinside.com 2019 - 2024. All rights reserved.