找不到端点 - Camel Http 集成

时间:2021-01-08 17:57:50

标签: apache-camel

我正在尝试使用 Apache Camel 运行一个简单的测试:

   from("http://localhost:61554/api/v1/MyController/my-endpoint")
            .to("direct:a")
            .log("$({body}");

我收到以下错误:“找不到端点:http://localhost:61554/api/v1/MyController/my-endpoint,请检查您的类路径是否包含所需的 Camel 组件 jar”

我对 Camel 和 Java 非常陌生。有人能告诉我为什么会出现这个错误吗?我应该使用 from("direct:x")... 吗?如果,那么我在哪里将我的“直接”端点映射到具体端点?

谢谢

1 个答案:

答案 0 :(得分:0)

您不能将 http 组件用作使用者(例如 in from) - 它是一个用于调用 HTTP 服务器的 http 客户端(因此它是一个生产者,例如 to)。

您可以使用camel-servlet、camel-jetty、camel-undertow等代替HTTP作为消费者。