M
M
Mark2019-07-05 16:59:01
Yii
Mark, 2019-07-05 16:59:01

What if we made an action on the API, but could not add it, for example, to the database?

Let's assume the situation:
We add some record (post, order) via API to a remote service, and we need to save some data (example ID) that the service returned. But it did not work out, because an error occurred (the database fell, a validation error). What to do in this case? In fact, as with Rollback, it will not work out, as with a database.
Scheme-example:
RISKNSQ.jpg
From ideas - write a log, notify the developer / administrator about it.

inb4: webhook

Частенько приходится работать с сервисами, которые его ещё не ввели и пока не планируют. Хочется знать лучшие практики при его отсутствии.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2019-07-05
@MarkLb

Put in a queue, and put monitoring on the queue - if not empty, then blow the bells. Well, in the log, of course. Resend queue, debug logs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question