Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello guys and girls
I have to develop an API Rest but I'm a bit a stuck.
I need to send data to this api, then it will do some things on it and send this restructured data to a service.
But some times I need to pause my API because this service is unavailable. I need to keep the data during unavailable time and send them when the service is up again.
btw, I know when the Service is up or down
Can someone help me somehow.
I use 2 methods, maybe could be useful for you:
1) API endpoint support maintenance mode response, when need I add change settings from 0 to 1 and endpoint start return to application "system in maintenance mode", in this cease application make retry later. This is required additional logic on the application side
2) the second method - instead of API use message queue, in this case, application, does not call API, but put a message in the queue
it fully asynchronous method - response comes in a different queue and not always in the same order, application put message and from time to time (or continuously ) get messages from response queue, check for what original message this response and etc.
in both cases, we could stop the central system for maintenance or for bulk processes (like monthly billing and invoicing)
I use 2 methods, maybe could be useful for you:
1) API endpoint support maintenance mode response, when need I add change settings from 0 to 1 and endpoint start return to application "system in maintenance mode", in this cease application make retry later. This is required additional logic on the application side
2) the second method - instead of API use message queue, in this case, application, does not call API, but put a message in the queue
it fully asynchronous method - response comes in a different queue and not always in the same order, application put message and from time to time (or continuously ) get messages from response queue, check for what original message this response and etc.
in both cases, we could stop the central system for maintenance or for bulk processes (like monthly billing and invoicing)