无法使用 camel-salesforce-3.4.0-SNAPSHOT 订阅 Salesforce Platform 事件
Unable to subscribe to Salesforce Platform Event with camel-salesforce-3.4.0-SNAPSHOT
我正在尝试订阅 Salesforce 中的平台事件:
from("salesforce:event/Moodle__e?replayId=-1")
.streamCaching()
.process( exchange ->{
PlatformEvent event = exchange.getIn().getBody(PlatformEvent.class);
System.out.println("*********Receive Event : " + event.getEventData().toString());
});
但是收到以下错误:
2020-05-21 14:23:35.061 WARN 3472 --- [ent@3cad68df-20] o.a.c.c.salesforce.SalesforceConsumer : Error subscribing to event/Moodle__e: {httpCode=500}. Caused by: [org.apache.camel.component.salesforce.api.SalesforceException - Error subscribing to event/Moodle__e: {httpCode=500}]
org.apache.camel.component.salesforce.api.SalesforceException: Error subscribing to event/Moodle__e: {httpCode=500}
at org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper.onMessage(SubscriptionHelper.java:446) [camel-salesforce-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
at org.cometd.common.AbstractClientSession$AbstractSessionChannel.notifyOnMessage(AbstractClientSession.java:583) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AbstractClientSession$AbstractSessionChannel.notifyMessageListeners(AbstractClientSession.java:568) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AbstractClientSession.notifyListeners(AbstractClientSession.java:308) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AbstractClientSession.lambda$receive(AbstractClientSession.java:269) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.bayeux.Promise.succeed(Promise.java:103) ~[bayeux-api-4.0.4.jar:4.0.4]
at org.cometd.common.AsyncFoldLeft$AbstractLoop.run(AsyncFoldLeft.java:199) ~[cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AsyncFoldLeft.run(AsyncFoldLeft.java:93) ~[cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AbstractClientSession.extendIncoming(AbstractClientSession.java:103) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AbstractClientSession.receive(AbstractClientSession.java:263) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.client.BayeuxClient.failMessage(BayeuxClient.java:810) ~[cometd-java-client-4.0.4.jar:4.0.4]
at org.cometd.client.BayeuxClient.messageFailure(BayeuxClient.java:806) ~[cometd-java-client-4.0.4.jar:4.0.4]
at org.cometd.client.BayeuxClient.messagesFailure(BayeuxClient.java:659) ~[cometd-java-client-4.0.4.jar:4.0.4]
at org.cometd.client.BayeuxClient$MessageTransportListener.onFailure(BayeuxClient.java:1266) ~[cometd-java-client-4.0.4.jar:4.0.4]
at org.cometd.client.transport.LongPollingTransport.onComplete(LongPollingTransport.java:255) ~[cometd-java-client-4.0.4.jar:4.0.4]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:218) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:210) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:543) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:523) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:486) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:326) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.http.HttpParser.parseFields(HttpParser.java:1161) ~[jetty-http-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1534) ~[jetty-http-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:200) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:141) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:75) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:156) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:543) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:398) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.ssl.SslConnection.succeeded(SslConnection.java:161) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.ChannelEndPoint.run(ChannelEndPoint.java:117) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_251]
Caused by: org.cometd.common.TransportException: {httpCode=500}
at org.cometd.client.transport.LongPollingTransport.onComplete(LongPollingTransport.java:254) ~[cometd-java-client-4.0.4.jar:4.0.4]
... 28 common frames omitted
我已经用其他客户端应用程序成功测试了这个事件。我也尝试了这个建议的解决方案来关闭 Salesforce 移动通知,但仍然遇到相同的错误:
是否有人成功订阅了 Salesforce Platform 事件或遇到过此错误并知道如何解决?
谢谢
您需要使用不同的 Salesforce API 版本,至少 37.0。
https://camel.apache.org/components/latest/salesforce-component.html#_query_parameters_45_parameters
您可以将 apiVersion 指定为端点参数。
我正在尝试订阅 Salesforce 中的平台事件:
from("salesforce:event/Moodle__e?replayId=-1")
.streamCaching()
.process( exchange ->{
PlatformEvent event = exchange.getIn().getBody(PlatformEvent.class);
System.out.println("*********Receive Event : " + event.getEventData().toString());
});
但是收到以下错误:
2020-05-21 14:23:35.061 WARN 3472 --- [ent@3cad68df-20] o.a.c.c.salesforce.SalesforceConsumer : Error subscribing to event/Moodle__e: {httpCode=500}. Caused by: [org.apache.camel.component.salesforce.api.SalesforceException - Error subscribing to event/Moodle__e: {httpCode=500}]
org.apache.camel.component.salesforce.api.SalesforceException: Error subscribing to event/Moodle__e: {httpCode=500}
at org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper.onMessage(SubscriptionHelper.java:446) [camel-salesforce-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
at org.cometd.common.AbstractClientSession$AbstractSessionChannel.notifyOnMessage(AbstractClientSession.java:583) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AbstractClientSession$AbstractSessionChannel.notifyMessageListeners(AbstractClientSession.java:568) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AbstractClientSession.notifyListeners(AbstractClientSession.java:308) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AbstractClientSession.lambda$receive(AbstractClientSession.java:269) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.bayeux.Promise.succeed(Promise.java:103) ~[bayeux-api-4.0.4.jar:4.0.4]
at org.cometd.common.AsyncFoldLeft$AbstractLoop.run(AsyncFoldLeft.java:199) ~[cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AsyncFoldLeft.run(AsyncFoldLeft.java:93) ~[cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AbstractClientSession.extendIncoming(AbstractClientSession.java:103) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.common.AbstractClientSession.receive(AbstractClientSession.java:263) [cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.client.BayeuxClient.failMessage(BayeuxClient.java:810) ~[cometd-java-client-4.0.4.jar:4.0.4]
at org.cometd.client.BayeuxClient.messageFailure(BayeuxClient.java:806) ~[cometd-java-client-4.0.4.jar:4.0.4]
at org.cometd.client.BayeuxClient.messagesFailure(BayeuxClient.java:659) ~[cometd-java-client-4.0.4.jar:4.0.4]
at org.cometd.client.BayeuxClient$MessageTransportListener.onFailure(BayeuxClient.java:1266) ~[cometd-java-client-4.0.4.jar:4.0.4]
at org.cometd.client.transport.LongPollingTransport.onComplete(LongPollingTransport.java:255) ~[cometd-java-client-4.0.4.jar:4.0.4]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:218) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:210) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:543) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:523) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:486) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:326) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.http.HttpParser.parseFields(HttpParser.java:1161) ~[jetty-http-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1534) ~[jetty-http-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:200) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:141) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:75) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:156) ~[jetty-client-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:543) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:398) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.ssl.SslConnection.succeeded(SslConnection.java:161) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.io.ChannelEndPoint.run(ChannelEndPoint.java:117) ~[jetty-io-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) ~[jetty-util-9.4.27.v20200227.jar:9.4.27.v20200227]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_251]
Caused by: org.cometd.common.TransportException: {httpCode=500}
at org.cometd.client.transport.LongPollingTransport.onComplete(LongPollingTransport.java:254) ~[cometd-java-client-4.0.4.jar:4.0.4]
... 28 common frames omitted
我已经用其他客户端应用程序成功测试了这个事件。我也尝试了这个建议的解决方案来关闭 Salesforce 移动通知,但仍然遇到相同的错误:
是否有人成功订阅了 Salesforce Platform 事件或遇到过此错误并知道如何解决? 谢谢
您需要使用不同的 Salesforce API 版本,至少 37.0。
https://camel.apache.org/components/latest/salesforce-component.html#_query_parameters_45_parameters
您可以将 apiVersion 指定为端点参数。