无法创建Camel Salesforce端点
我正在尝试使用Apache Camel Salesforce组件连接到Salesforce。
这是我试图开始的一条非常简单的路由:
@Override
public void configure() throws Exception {
from("salesforce:event/Case__e")
.to("mock:end");
}
尝试启动它时,我会发现一个明显的错误,说我没有指定客户端ID:
Caused by: java.lang.IllegalArgumentException: clientId must be specified
at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:149) ~[camel-util-3.16.0.jar:3.16.0]
at org.apache.camel.component.salesforce.SalesforceLoginConfig.validate(SalesforceLoginConfig.java:238) ~[camel-salesforce-3.16.0.jar:3.16.0]
这是完全有意义的,因为必须指定ClentID参数。为了解决这个问题,我正在指定 clientId
如下:
@Override
public void configure() throws Exception {
from("salesforce:event/Case__e?clientId=xyz")
.to("mock:end");
}
当尝试启动这段路线时,我会遇到一个相当奇怪的错误,抱怨 clientId
是一个未知参数:
Failed to resolve endpoint: salesforce://event/Case__e?clientId=xyz due to: There are 1 parameters that couldn't be set on the endpoint.
Check the uri if the parameters are spelt correctly and that they are properties of the endpoint.
Unknown parameters=[{clientId=xyz}]
不确定我做错了什么,我应该如何解决这个问题。
预先感谢您的投入。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题与以下事实有关:是组件选项 ,因此必须在组件级别上配置它,而您尝试将其配置为查询参数/端点选项,该选项无法正常工作。
根据您使用的运行时间,配置组件的方法可能会更改,但想法保持不变。
例如,假设您使用
application.properties
来配置您的应用程序,则您的Salesforce组件的配置看起来像这样:in Application.properties
这是Salesforce示例
Your problem is related to the fact that
clientId
is a component option so it must be configured at the component level while you try to configure it like it was a query parameter / an endpoint option which cannot work.Depending on the runtime that you use, the way to configure a component may change but the idea remains the same.
For example, assuming that you use an
application.properties
to configure your application, the configuration of your salesforce component would look like this:In application.properties
Here is a salesforce example https://github.com/apache/camel-examples/blob/main/examples/salesforce-consumer/