You need to sign in to do that
Don't have an account?
Error Handling and recovery during Salesforce integration
Hi ,
I am new to Salesforce development, and I am doing my first project on integrating Salesforce and external systems. My remote system will use the REST API to create/update/delete data in Salesforce. I read the following in the Salesforce document :
"Error handling—All the remote call-in methods, standard or custom APIs, require the remote system to handle any subsequent errors, such as timeouts and the management of retries. Middleware can be used to provide the logic for error handling and recovery.
• Recovery—A custom retry mechanism needs to be created if quality-of-service requirements dictate it. In this case, it’s important to ensure idempotent design characteristics. Platform event enables subscribers to use the replay ID to fetch messages within a certain time period after those messages were published."
Can anyone please tell me what kind of errors and recovery I will have to take care of in my remote system? Any links will be very helpful for me. I am not using any middleware, in what cases should I consider using a middleware.
How your remote system is planning to use the Salesroce REST APIs to perform DML operations in Salesforce?
There are couple of tools can be used which has built in mehcanism for retry in case of any failures.
- Mulesoft
- Boomi
- Microsoft Azure
If you are planning to custom create build something like .Net API, Nodejs etc. then I will think you need to possibly build something to capture those failures into some Database and build some kind of reprocessing to process those fail records.Please keep in mind in that case I believe you need to keep in mind the API Request Limit (What is the Edition of your Production Org, Professional, Enterprise, Unlimited etc)
Another suggestion is to use Pubsub mechanism (recommended) using Platform Events. In that case you need to do the following
All Answers
Standard Rest APIs
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm
Error Codes
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/errorcodes.htm
Thank you very much !
Do we definitely need a middleware to handle all these ? or is it fine to handle it in the remote system itself?
How your remote system is planning to use the Salesroce REST APIs to perform DML operations in Salesforce?
There are couple of tools can be used which has built in mehcanism for retry in case of any failures.
- Mulesoft
- Boomi
- Microsoft Azure
If you are planning to custom create build something like .Net API, Nodejs etc. then I will think you need to possibly build something to capture those failures into some Database and build some kind of reprocessing to process those fail records.Please keep in mind in that case I believe you need to keep in mind the API Request Limit (What is the Edition of your Production Org, Professional, Enterprise, Unlimited etc)
Another suggestion is to use Pubsub mechanism (recommended) using Platform Events. In that case you need to do the following
Hi Abdul, Thank you very much for the detailed solutions.
Please correct me if I am wrong,
For remote call-in pattern, Platform events support only create operation right? I read that in Integration pattern documentation (Attached to this message).
Yes, In pubsub pattern, platform events only work on AfterInsert because whenever event publish it creates a record for that event define through Platform events.
@RituSharma
Please help him with some more details about what middleware, what do you have in your mind and how he can use it without having any kind of logging, error handling and retry mechanism so we all can get educated.