I'm initializing a long process on a request on the controller. I want to create a request object with Id, Status and other data and send it as a response to the client, so client doesn't wait for the whole process. It is like
private Mono<ProcessRequest> initializeProcess(List<String> params) {
return Mono.just(new ProcessRequest(params)) // this is what I want to return
.flapMap(request -> {
// this is what I want to do after returning mono of request to the client
})
}
Is it possible to do it like this way or the only option is to use some messaging like Kafka to perform computations after returning the response to the client?