嗨,我编写了我的自定义骆驼组件,它一直在工作,直到我升级版本。我将我的版本 3.1 升级到 3.2 但出现错误
Resolved [org.apache.camel.NoSuchEndpointException: No endpoint could be found for: my-rest-client, please check your classpath contains the needed Camel component jar.]
我检查了骆驼文档,但不清楚。
https://camel.apache.org/manual/latest/camel-3x-upgrade-guide-3_2.html
我尝试了一些东西,但没有任何改变 这不起作用
//camelContext.getRestConfiguration("servlet",true); 3.1 code deleted to upgrade 3.2
CamelContextHelper.getRestConfiguration(camelContext,"servlet"); 3.2
我尝试将 camel-http,camel-direct 添加到我的 pom 中,但没有影响。
Component("MYClientEndpoint")
@UriEndpoint(scheme = "my-rest-client",title = "my-rest-client",syntax = "my-rest-client")
public class MYClientEndpoint extends DefaultEndpoint {
@Autowired
private MYClientProducer MYClientProducer;
@Override
public Producer createProducer() {
return MYClientProducer;
}
@Override
public Consumer createConsumer(Processor processor) {
throw new UnsupportedOperationException("Operation not supported");
}
@Override
public boolean isSingleton() {
return true;
}
@Override
public String getEndpointUri() {
return "my-rest-client";
}
}
它已经存在于我的应用程序上下文中。我可以在自动装配时访问它