Closed tanayamitra05 closed 4 years ago
Depends on your use case, if fetching data using Flux is done in a completely asynchronous way, then that would be ideal and fastest. Otherwise, if using blocking calls, its effectively same as using normal list collection in java.
I am fetching the data like:
Flux
and the repository code:
public interface CMLogsRepository extends ReactiveCosmosRepository<CentralizedManagementEntity, String> {
Flux
But there is no such timing difference in this case.
@tanayamitra05 when you run reactive code like this :
Flux<T> cmLogs = cmLogsRepository.findAll();
it doesn't execute the find all operation at this point until you subscribe to it. So measuring timing at this point doesn't even makes sense.
Please read project reactor docs for more details on how to run reactive asynchronous code. https://projectreactor.io/learn
Is there any significant time difference for fetching data by using Flux in reactive and normal List Collection in Java?