You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Zoran Regvart (Jira)" <ji...@apache.org> on 2021/01/27 12:05:00 UTC

[jira] [Comment Edited] (CAMEL-16084) salesforce: Out of order execution

    [ https://issues.apache.org/jira/browse/CAMEL-16084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17272807#comment-17272807 ] 

Zoran Regvart edited comment on CAMEL-16084 at 1/27/21, 12:04 PM:
------------------------------------------------------------------

Not 100% sure what the problem is, but I played around with a simple route with split/aggregation without {{synchronous}} seems to work okay with Salesforce. This is the route:
{code:java}
import static java.util.Arrays.asList;
import static org.apache.camel.builder.AggregationStrategies.groupedBody;

from("direct:start")
    .split(body(), groupedBody())
        .to("salesforce:getSObject?sObjectName=Contact&rawPayload=true")
        .transform().jsonpath("$.FirstName")
        .log("individual: ${body}")
    .end()
    .log("aggregated: ${body[0]} ${body[1]} ${body[2]}"); // just to get a nicer output, GroupedExchangeList overrides toString
{code}
I'm triggering the route with a list of IDs:
{code:java}
producer.sendBody("direct:start", asList("0030Y000002vBoFQAU", "0030Y000002vBoGQAU", "0030Y000002vBoHQAU")){code}
This gives me:
{code:java}
2021-01-27 13:02:02,425 INFO  [SalesforceHttpClient@156b88f5-20] route1: individual: Rose
2021-01-27 13:02:02,503 INFO  [SalesforceHttpClient@156b88f5-20] route1: individual: Sean
2021-01-27 13:02:02,587 INFO  [SalesforceHttpClient@156b88f5-19] route1: individual: Jack
2021-01-27 13:02:02,626 INFO  [SalesforceHttpClient@156b88f5-19] route1: aggregated: Rose Sean Jack
{code}


was (Author: zregvart):
Not 100% sure what the problem is, but I played around with a simple route and aggregation without {{synchronous}} seems to work okay with Salesforce. This is the route:
{code:java}
import static java.util.Arrays.asList;
import static org.apache.camel.builder.AggregationStrategies.groupedBody;

from("direct:start")
    .split(body(), groupedBody())
        .to("salesforce:getSObject?sObjectName=Contact&rawPayload=true")
        .transform().jsonpath("$.FirstName")
        .log("individual: ${body}")
    .end()
    .log("aggregated: ${body[0]} ${body[1]} ${body[2]}"); // just to get a nicer output, GroupedExchangeList overrides toString
{code}
I'm triggering the route with a list of IDs:
{code:java}
producer.sendBody("direct:start", asList("0030Y000002vBoFQAU", "0030Y000002vBoGQAU", "0030Y000002vBoHQAU")){code}
This gives me:
{code:java}
2021-01-27 13:02:02,425 INFO  [SalesforceHttpClient@156b88f5-20] route1: individual: Rose
2021-01-27 13:02:02,503 INFO  [SalesforceHttpClient@156b88f5-20] route1: individual: Sean
2021-01-27 13:02:02,587 INFO  [SalesforceHttpClient@156b88f5-19] route1: individual: Jack
2021-01-27 13:02:02,626 INFO  [SalesforceHttpClient@156b88f5-19] route1: aggregated: Rose Sean Jack
{code}

> salesforce: Out of order execution
> ----------------------------------
>
>                 Key: CAMEL-16084
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16084
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-salesforce
>    Affects Versions: 3.7.1
>            Reporter: Jeremy Ross
>            Assignee: Jeremy Ross
>            Priority: Major
>
> When using a salesforce operation after an aggregator,  control seems to return to the aggregate caller immediately instead of proceeding with processors downstream from the salesforce operation. This is the behavior I'd expect if using the aggregator with parallelProcessing.
> I believe this is longstanding behavior, however with the removal of the `synchronous` option from the salesforce component (CAMEL-14138), we've removed a workaround to this issue. 
> I'm seeing the same behavior with a salesforce operation via a wiretap with a threadpool with poolsize, maxsize and queuesize of 1, which should effectively behave in a synchronous manner.
> Test case: https://gist.github.com/jeremyross/4d7d14a33452edf236faefda77ad3e3d



--
This message was sent by Atlassian Jira
(v8.3.4#803005)