0 Replies Latest reply on Dec 5, 2018 4:51 AM by msebi

    Creating minimalist examples in camel (namely salesforce)

    msebi

      I'm testing the salesforce component (streaming API) across different versions of camel (2.17.4/2.23.0). In 2.23.0 I got an example running using spring (based on camel/examples/camel-example-twitter-salesforce at master · apache/camel · GitHub ):

       

      SalesforceLauncher.java

      package org.apache.camel.example.mention;
      import org.springframework.boot.SpringApplication;
      import org.springframework.boot.autoconfigure.SpringBootApplication;
      
      
      //CHECKSTYLE:OFF
      @SpringBootApplication
      public class SalesforceLauncher {
      
      
          /**
           * A main method to start this application.
           */
          public static void main(String[] args) {
              SpringApplication.run(SalesforceLauncher.class, args);
          }
      
      
      }
      //CHECKSTYLE:ON
      
      
      
      
      
      
      

       

      SalesforceRoute.java

      import org.apache.camel.builder.RouteBuilder;
      import org.springframework.stereotype.Component;
      
      
      @Component
      public class SalesforceRoute extends RouteBuilder {
      
      
          @Override
          public void configure() throws Exception {
              from("salesforce:UpdateAccount?notifyForFields=ALL&notifyForOperations=ALL").tracing().convertBodyTo(String.class).to("file:D:/tmp/work/").log("SObject ID: ${body}");
          }
      }
      
      
      
      
      
      

       

      and pom.xml:

       

      https://pastebin.com/raw/HnXJRAMy

       

      Moving the example to 2.17.4 generates:

       

      Failed to create route route1: Route(route1)[[From[salesforce:All_Account_Change?notifyForF... because of Failed to resolve endpoint: salesforce://All_Account_Change?notifyForFields=ALL&notifyForOperations=ALL due to: No component found with scheme: salesforce

       

      This persists even if the salesforce component is added to the pom (the component from 2.17.4). A maven build shows the following output:

       

      [INFO] Scanning for projects...

      [ERROR] [ERROR] Some problems were encountered while processing the POMs:

      [ERROR] Non-resolvable import POM: Failure to find org.apache.camel:camel-spring-boot-dependencies:pom:2.17.8-SNAPSHOT in http://repository.apache.org/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of apache.snapshots has elapsed or updates are forced @ org.apache.camel:camel-example-twitter-salesforce:[unknown-version], D:\camel\examples\camel-example-twitter-salesforce\pom.xml, line 53, column 19

      [ERROR] 'dependencies.dependency.version' for org.apache.camel:camel-salesforce-starter:jar is missing. @ org.apache.camel:camel-example-twitter-salesforce:[unknown-version], D:\camel\examples\camel-example-twitter-salesforce\pom.xml, line 70, column 17

      @

      [ERROR] The build could not read 1 project -> [Help 1]

      [ERROR]

      [ERROR]   The project org.apache.camel:camel-example-twitter-salesforce:2.17.8-SNAPSHOT (D:\camel\examples\camel-example-twitter-salesforce\pom.xml) has 2 errors

      [ERROR]     Non-resolvable import POM: Failure to find org.apache.camel:camel-spring-boot-dependencies:pom:2.17.8-SNAPSHOT in http://repository.apache.org/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of apache.snapshots has elapsed or updates are forced @ org.apache.camel:camel-example-twitter-salesforce:[unknown-version], D:\Work\SAP-CPI\camel-tests\camel-2.17.4-original\camel\examples\camel-example-twitter-salesforce\pom.xml, line 53, column 19 -> [Help 2]

      [ERROR]     'dependencies.dependency.version' for org.apache.camel:camel-salesforce-starter:jar is missing. @ org.apache.camel:camel-example-twitter-salesforce:[unknown-version], D:\camel\examples\camel-example-twitter-salesforce\pom.xml, line 70, column 17

      [ERROR]

      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

      [ERROR] Re-run Maven using the -X switch to enable full debug logging.

      [ERROR]

      [ERROR] For more information about the errors and possible solutions, please read the following articles:

      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

      [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

       

      What would be a minimalist (preferably without using spring) salesforce streaming client (with no DTOs needed (only fetching updates from Salesforce))?