0

This question caught my attention for several times, but I am not able to find satisfactory answer after google it.

Normally, when we integrate sf with other external system, we rarely talk out negative scenario like external system outage.

For example, SF is integrating with external system 1, it makes callout to external system 1 to create some records from time to time. Now, this external system 1 is down for maintenance for weeks.

Now the external system is back online, we want to retry all the missed callouts during the downtime. What is the best solution for situation like this? Can Middleware get the job done? Queueing those callouts and retry when external system back online?

1

2 Answers 2

2

The queue and wait model might work, but it depends on how real-time you need the updates to be, how long you expect to recover from the overflow, etc. The reason why it's rarely talked about in concrete terms is because every situation is more-or-less unique depending on circumstances. If your external system can only handle a few records per second, then it doesn't matter how fast Salesforce can go, you have to wait. If your system has extra capabilities, you might be able to take advantage of the getUpdated/getDeleted/retrieve in the external system to get up to date very quickly. Or you might use middleware. Or a Batchable class backed by a "callout log" object. There's no one right answer to every situation.

1

It's a very wide topic but let's consider the following scenario:

Salesforce is a system of record and it is sending all new leads to some marketing tool (in other words synchronizes some eligible Leads from SFDC to Marketing Tool). Let's assume we're using custom synchronization that is orchestrated by SFDC. There are avg 10 leads per 24h.

Assume not having leads for three days (around 30 leads) it's not a big deal. We can have a manual "fail-over" by simply loading them manually to the Marketing Tool.

Problems to consider: Probably, there's a batch that is calling out the external service then setting the flag 'synchronized' on every lead that was successfully in sync w the Marketing Tool. This batch will be constantly trying to call the service even if it's down for three days. If you're ok with manual "fail-over", then just tear it down and wait until the external system is fixed.

An alternative solutions,

  1. A fully automated solution that needs no middleware: Use the combination of the two followings: retry pattern and circuit breaker patern. please refer https://docs.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker

  2. Use queue as described by @sfdcfox. In SFDC you can simply start using platform events that is actually a queue.

  3. Use middleware: mulesoft, boomi etc. that will handle fail-over logic. But it brings a lot of complexity. Please refer to the following links:

https://blogs.mulesoft.com/dev-guides/how-to-tutorials/error-handling-integration-patterns/

https://wso2.com/library/articles/2016/03/article-design-for-failure-integration-error-handling-part-1/

https://wso2.com/library/articles/2016/05/article-design-for-failure-integration-error-handling-part-2/

Also, I recommend looking in the following book "Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .