Accelerator Salesforce Bulk System API - Implementation Template
Instructions
- The API listens on accel-sfdc-bulk-request-queue for bulk requests.
The format of the bulk request is {
"x-correlation-id": "1234", //unique identifier to trace this transaction "object" : "Account", //Salesforce object "externalId": "External_ID__c" //unique Identifier on the SF object needed to perform upsert operation "records": [] //actual object records that need to be upserted
}
- The API used Salesforce Bulk API v2 upsert operation to send upsert request to Salesforce.
- The upsert job id returned by salesforce is pushed to the response queue, accel-sfdc-bulk-response-queue. The format of the response message is shown below:: { "x-correlation-id": "1234", //this is same as the id from the request body "jobId": "afafere89af" // salesforce bulk job id }
- If there is an error while sending the upsert request or before sending the upsert request, the request message is sent back to the queue for retry. Currently a retry limit of 2 is set, if the retry limit is exhausted the message will be moved to the dead letter queue, accel-sfdc-bulk-request-queue-dlq.
- The consumer of this API can use the jobId to query the status of the salesforce bulk request using the endpoint, api/bulk/job/{jobId}/
- Two more endpoints are exposed to get the successful and failed records. /api/bulk/jobs/{jobId}/status/successful and /api/bulk/jobs/{jobId}/status/failed