Do business logic after giving an HTTP response

We have a case where a user, uses our exposed api. We need to give back first a HTTP response ( the user needs a "succes" feedback within 10 sec. and after that we need to excecute our own logic.  How can we do this? 
2 answers

Typically, you do this by accepting the request, storing it in your database, sending a response and then process the request. You can use the ProcessQueue module to processing the request later. I would recommend this option, because you can handle concurrent requests and each request is executed in its own transaction.


Alternatively, as the most basic solution, you could have a ScheduledEvent running which checks in the database if there are any new requests present.


If you’re using Mendix 7+, have a look at the REST microflow actions.

These will allow you to get a HTTP reponse from your API, query that response and then perform whatever logic you require.

You can do this in 7 too.