Unable to subscribe to Salesforce Platform Event with camel-salesforce-3.4.0-SNAPSHOT

2020-05-20 Thread Anne Nguyen
Hi All,

I'm trying to subscribe to a Platform Event in 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());
   });

However receive the following error:

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$7.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$4(AbstractClientSession.java:269)
[cometd-java-common-4.0.4.jar:4.0.4]
at org.cometd.bayeux.Promise$2.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$2.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.v

Camel Salesforce Component can't find Platform Event object

2020-05-20 Thread Anne Nguyen
0

I have used camel-salesforce-maven-plugin to generate the DTO and have
successfully created a Contact record. However, when I tried to emit an
event following the docs on:

https://camel.apache.org/components/latest/salesforce-component.html

I received the following error:

2020-05-21 13:30:47.844 ERROR 4276 --- [ent@3c50ad4b-22]
o.a.c.p.e.DefaultErrorHandler: Failed delivery for (MessageId:
ID-DESKTOP-UO2CP5I-1590033642730-0-7 on ExchangeId:
ID-DESKTOP-UO2CP5I-1590033642730-0-7). Exhausted after delivery attempt: 1
caught: org.apache.camel.component.salesforce.api.NoSuchSObjectException:
{errors:[{"errorCode":"NOT_FOUND","message":"The requested resource does
not exist","fields":null}],statusCode:404}

Message History (complete message history is disabled)
---
RouteId  ProcessorId  Processor
   Elapsed (ms)
[moodle-event  ] [moodle-event  ] [from[timer://hello?period=2000]
  ] [81]
...
[moodle-event  ] [to3   ]
[salesforce:createSObject?sObjectName=Moodle__e
   ] [ 0]

Stacktrace
---

org.apache.camel.component.salesforce.api.NoSuchSObjectException:
{errors:[{"errorCode":"NOT_FOUND","message":"The requested resource does
not exist","fields":null}],statusCode:404}
at
org.apache.camel.component.salesforce.internal.client.DefaultRestClient.createRestException(DefaultRestClient.java:110)
~[camel-salesforce-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
at
org.apache.camel.component.salesforce.internal.client.AbstractClientBase$1.onComplete(AbstractClientBase.java:231)
~[camel-salesforce-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
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$2.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$2.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.v2020022

Re: add/remove JAAS users and roles within a Camel route?

2020-05-20 Thread Gerald Kallas
Tx JB.

So in this case, how can i call the jaas:* service from a Camel route? I did 
some research but wasn't able to find this ..

Regards
- Gerald

> Jean-Baptiste Onofre  hat am 20. Mai 2020 20:25 
> geschrieben:
> 
>  
> Hi,
> 
> You mean on a JAAS backend ?
> 
> JAAS doesn’t provide anything about that. That’s why in Karaf we have the 
> "backend" service attached to some login modules.
> In your Camel route, you can interact with these services (as the jaas:* 
> commands do in Karaf).
> 
> Regards
> JB
> 
> > Le 20 mai 2020 à 19:50, Gerald Kallas  a écrit :
> > 
> > Hi all,
> > 
> > is it possible to add/remove users and roles inside a Camel route 
> > (Blueprint DSL) or at least w/ a piece of Java code inside a bean?
> > 
> > Thanks in advance for any hints
> > - Gerald


Re: add/remove JAAS users and roles within a Camel route?

2020-05-20 Thread Jean-Baptiste Onofre
Hi,

You mean on a JAAS backend ?

JAAS doesn’t provide anything about that. That’s why in Karaf we have the 
"backend" service attached to some login modules.
In your Camel route, you can interact with these services (as the jaas:* 
commands do in Karaf).

Regards
JB

> Le 20 mai 2020 à 19:50, Gerald Kallas  a écrit :
> 
> Hi all,
> 
> is it possible to add/remove users and roles inside a Camel route (Blueprint 
> DSL) or at least w/ a piece of Java code inside a bean?
> 
> Thanks in advance for any hints
> - Gerald



add/remove JAAS users and roles within a Camel route?

2020-05-20 Thread Gerald Kallas
Hi all,

is it possible to add/remove users and roles inside a Camel route (Blueprint 
DSL) or at least w/ a piece of Java code inside a bean?

Thanks in advance for any hints
- Gerald


Simple JMS Batch Component

2020-05-20 Thread Shenavai, Manuel
Hi everyone,

I started looking into the Simple JMS Batching 
component.
 In our use-case we like to fetch several messages from JMS and aggregate them 
into a single message which is then processed. The Camel Simple JMS 
Batch 
component seems to do just that. However I found Camel Simple 
JMS2 which 
states that it also supports batch consumer and producer. From the docs I 
understood that with Simple JMS2 consumer it's possible to process multiple 
messages in a single transaction. But I could not find any information of 
batching messages with an aggregation. So I assume for my use-case Simple JMS 
Batch is the one to use. Is this understanding correct?

Thanks in advance &
Best regards,
Manuel


[ANNOUNCEMENT] Apache Camel-kafka-connector 0.2.0

2020-05-20 Thread Andrea Tarocchi
The Camel community announces the immediate availability of Apache
Camel-kafka-connector 0.2.0

The artifacts are published and ready for you to download either from
the Apache mirrors or from maven central.
For more info please visit the project GitHub repository[1].

Many thanks to all who made this release possible.

Regards,
Andrea.

[1] https://github.com/apache/camel-kafka-connector


Re: Camel 3: error with Mockito

2020-05-20 Thread John Poth
Hi Andriy, can you try specifying the method you want to call in you route
i.e

.bean(positionMapItem, "map") ? Thanks !

On Tue, May 19, 2020 at 8:00 PM Andriy Klymenko
 wrote:

> Hi,
>
>
>
> We use Camel 2 in our project for more than 3 years.
>
> Recently we decided to migrate to *Camel 3* but faced a problem in unit
> tests.
>
>
>
> Our unit tests don't work as before: *Mockito invokes a real method*
> instead of mocked one.
>
> Moreover, it depends on environment- everything works as expected on
> Windows 10 Pro(v1809), but *fails on Linux* (Ubuntu 18.04.3 LTS, CentOS
> Linux 7).
>
> In both of cases we use Java 8 (build 1.8.0_201-b09) and Maven 3.6.3.
>
>
>
> I prepared a simple project that can help to reproduce this error. You can
> find it in the attachment.
>
> Could you take a look at this example and help me to solve this problem?
>
>
>
> Best regards,
>
> Andriy Klymenko
>
> E-mail: andriy.klymenko@sigma.software
>
>
>