I have the following scenario:
I send data to a 3rd party (a SOAP service as it happens). The external service accepts my data, and gives me a unique reference which I then can use to call a second SOAP service to see if my data has been processed.
So I need to poll the second service until I get a response back from it saying my data is ready. Once it's ready my flow can end (I just want to write the fact that it's ready to a database table). If I poll a certain number of times and it's not ready I want to give up and call some sort of exception processing.
I can't work out what I should use for the polling; i.e. the logic for checking the result of my soap call and polling again after a set amount of time. The time I have to wait could be dynamic - for example the 3rd party service that is called might say "it's not ready yet, try again in 5 minutes" so that I have to poll again in 5 minutes.
Does anyone have an idea of how I would do the above in Spring integration, using the Java (or preferably) Kotlin DSL ?
I'm just trying to work out if Spring Integration is the right tool for the job here.