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&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.
- clones
-
ENTESB-7903 camel-salesforce query attributes are not mapped correctly
- Done