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

camel-salesforce query attributes are not mapped correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • fuse-7.0
    • jboss-fuse-6.3, fuse-7.0
    • Camel
    • None
    • % %

      This issue is fixed in Wildfly Camel in ENTESB-7903, but I was able to reproduce it also on jboss-fuse on karaf.

      Attributes returned by salesforce for a camel "query", are not correctly mapped to dto objects in camel-salesforce. For instance, when the following is executed:

      <to uri="salesforce:query?sObjectQuery=SELECT Id,AccountNumber FROM Account&amp;sObjectClass=org.apache.camel.salesforce.dto.QueryRecordsAccount"/>
      

      Debugging results:
      brakepoint: https://github.com/jboss-fuse/camel/blob/2.17.0.redhat-6-3-x-R8/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/JsonRestProcessor.java#L156

      new BufferedReader(new InputStreamReader(responseEntity))
        .lines().collect(Collectors.joining("\n"))
      

      returns following:

      {"totalSize":9,"done":true,"records":[{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6lAAF"},"Id":"001b000000G2Y6lAAF","AccountNumber":"CD355120-B"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6mAAF"},"Id":"001b000000G2Y6mAAF","AccountNumber":"CD451796"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6nAAF"},"Id":"001b000000G2Y6nAAF","AccountNumber":"CD656092"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6qAAF"},"Id":"001b000000G2Y6qAAF","AccountNumber":"CD439877"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6rAAF"},"Id":"001b000000G2Y6rAAF","AccountNumber":"CC947211"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6jAAF"},"Id":"001b000000G2Y6jAAF","AccountNumber":"CC978213"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6kAAF"},"Id":"001b000000G2Y6kAAF","AccountNumber":"CD355119-A"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6sAAF"},"Id":"001b000000G2Y6sAAF","AccountNumber":"CD736025"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6tAAF"},"Id":"001b000000G2Y6tAAF","AccountNumber":"CD355118"}]}
      objectMapper.readValue(responseEntity, responseClass).toString()
      

      returns:

      {"done":true,"totalSize":9,"records":[{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6lAAF"},"Id":"001b000000G2Y6lAAF"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6mAAF"},"Id":"001b000000G2Y6mAAF"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6nAAF"},"Id":"001b000000G2Y6nAAF"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6qAAF"},"Id":"001b000000G2Y6qAAF"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6rAAF"},"Id":"001b000000G2Y6rAAF"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6jAAF"},"Id":"001b000000G2Y6jAAF"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6kAAF"},"Id":"001b000000G2Y6kAAF"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6sAAF"},"Id":"001b000000G2Y6sAAF"},{"attributes":{"type":"Account","url":"/services/data/v37.0/sobjects/Account/001b000000G2Y6tAAF"},"Id":"001b000000G2Y6tAAF"}]}
      

      As you can see AccountNumber attribute is lost.

            zregvart@redhat.com Zoran Regvart
            jbouska@redhat.com Jan Bouska
            Jan Bouska Jan Bouska
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: