骆驼休息整合

时间:2021-06-01 19:53:43

标签: java spring-boot apache-camel

我想调用一个休息端点,并在使用 Apache Camel RouteBuilder 进行一些处理后将其发布到另一个端点。我该怎么做?

这只是我在本地尝试的示例代码。 (最终的集成将在不同的端点和不同的身份验证机制下完成)

from("rest:get:/employees")
    .log("log:first-timer") 
    .setHeader(Exchange.HTTP_METHOD, constant("POST"))
    .setHeader(Exchange.CONTENT_TYPE, constant("application/json"))
    .setBody(constant("Username: ABC, Password: ABC, Country: UK"))
    .to("rest:post:/employee");
<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-spring-boot-starter</artifactId>
    <version>3.2.0</version>
</dependency>
        
<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-rest-starter</artifactId>
    <version>3.2.0</version>
</dependency>

我得到以下内容

Caused by: java.lang.IllegalArgumentException: Component rest is not a
RestConsumerFactory

0 个答案:

没有答案