Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-15219

Salesforce Kamelet ignores topicName parameter in property-based configuration

XMLWordPrintable

    • False
    • False
    • % %
    • build1
    • Undefined
    • Hide

      salesforce-source.groovy:

      from('kamelet:salesforce-source')
        .to("log:info")
      

      salesforce.properties:

      camel.kamelet.salesforce-source.loginUrl = https://login.salesforce.com
      camel.kamelet.salesforce-source.userName = XX
      camel.kamelet.salesforce-source.password = XX
      camel.kamelet.salesforce-source.clientId = XX
      camel.kamelet.salesforce-source.clientSecret = XX
      camel.kamelet.salesforce-source.query= SELECT Id, Name FROM Contact
      camel.kamelet.salesforce-source.topicName = kamelet-topic2
      
      1. kamel install --olm=false --operator-image=registry-proxy.engineering.redhat.com/rh-osbs/integration-tech-preview-camel-k-rhel8-operator:1.2.0-5 --maven-repository=http://nexus.fuse-qe.eng.rdu2.redhat.com/repository/fuse-all
      2. oc apply -f salesforce-source.kamelet.yaml
      3. kamel run salesforce-source.groovy --property-file salesforce.properties --dev
      4. Salesforce Developer Console: SELECT Id, Name FROM PushTopic
      Show
      salesforce-source.groovy: from( 'kamelet:salesforce-source' ) .to( "log:info" ) salesforce.properties: camel.kamelet.salesforce-source.loginUrl = https: //login.salesforce.com camel.kamelet.salesforce-source.userName = XX camel.kamelet.salesforce-source.password = XX camel.kamelet.salesforce-source.clientId = XX camel.kamelet.salesforce-source.clientSecret = XX camel.kamelet.salesforce-source.query= SELECT Id, Name FROM Contact camel.kamelet.salesforce-source.topicName = kamelet-topic2 kamel install --olm=false --operator-image=registry-proxy.engineering.redhat.com/rh-osbs/integration-tech-preview-camel-k-rhel8-operator:1.2.0-5 --maven-repository= http://nexus.fuse-qe.eng.rdu2.redhat.com/repository/fuse-all oc apply -f salesforce-source.kamelet.yaml kamel run salesforce-source.groovy --property-file salesforce.properties --dev Salesforce Developer Console: SELECT Id, Name FROM PushTopic

      On OCP 4.5, with Camel-K build #5 (https://issues.redhat.com/browse/ENTESB-15086), Salesforce Kamelet (https://github.com/openshift-integration/kamelet-catalog/blob/master/salesforce-source.kamelet.yaml) I observed following behavior:

      Salesforce Kamelet in case of property-based configuration subscribes to "topic/sampleTopic" channel although in property file is specified different topicName. It doesn't create the topic/channel "kamelet-topic2" described by property camel.kamelet.salesforce-source.topicName (checked in Salesforce Developer Cosole).

      • if topic/sampleTopic already exists:
        2020-10-28 21:25:18,813 INFO [org.apa.cam.com.sal.int.str.PushTopicHelper] (main) Found existing topic sampleTopic: {"attributes": {"referenceId":null,"type":"PushTopic","url":"/services/data/v34.0/sobjects/PushTopic/0IF5p000000g0YdGAI"}
        ,"Query":"SELECT Id FROM Contact","Description":"Topic created by Camel Salesforce component","ApiVersion":34.0,"NotifyForFields":"All","NotifyForOperationCreate":true,"NotifyForOperationDelete":false,"NotifyForOperationUndelete":false,"NotifyForOperationUpdate":false,"NotifyForOperations":"Create","IsActive":true,"Name":"sampleTopic","Id":"0IF5p000000g0YdGAI"}
         [1] 2020-10-28 21:25:18,813 INFO [org.apa.cam.com.sal.int.str.PushTopicHelper] (main) Updating Topic sampleTopic with Query [SELECT Id, Name FROM Contact]
         [1] 2020-10-28 21:25:24,289 INFO [org.apa.cam.com.sal.int.str.SubscriptionHelper] (main) Subscribing to channel /topic/sampleTopic...
         [1] 2020-10-28 21:25:24,291 INFO [org.apa.cam.imp.eng.InternalRouteStartupManager] (main) Route: salesforce-source-C93C247A75A3830-0000000000000000 started and consuming from: wrap:salesforce:sampleTopic
        
      •  if topic/sampleTopic doesn't exist in the Salesforce account, it is created (checked in Salesforce Developer Console), but the log provides null values instead of attributes' details:
        [1] 2020-10-28 21:38:28,392 INFO [org.apa.cam.com.sal.int.str.PushTopicHelper] (main) Creating Topic sampleTopic: {"attributes":{"referenceId":null,"type":null,"url":null},"Query":"SELECT Id, Name FROM Contact","Description":"Topic created by Camel Salesforce component","ApiVersion":34.0,"NotifyForFields":"All","NotifyForOperationCreate":true,"NotifyForOperationDelete":false,"NotifyForOperationUndelete":false,"NotifyForOperationUpdate":false,"Name":"sampleTopic"}
        

              dbokde Dhiraj Bokde
              lfabriko@redhat.com Lucie Krejcirova
              Lucie Krejcirova Lucie Krejcirova
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: