I am working / preparing an application based on a producer / consumer model. In my case, there will be one manufacturer that generates several million (non-trivial) tasks, and there will be a customized number of consumers.
The relationship between producer and consumer is primarily queue based. However, I am worried about memory consumption: it is possible that the number of tasks will exceed the available memory for the JVM. Therefore, I would like to have a Queue implementation that only saves the number of elements of the "top-X" queue in memory and saves the rest on disk. This does not have to be resilient in the sense that he does not need to survive restarting the program.
I searched around, but cannot find the Queue implementation that seems to be widely used (there seem to be a few that I call realistic concepts, but I am worried about the future support / further development of these implementations). I also look at external message queue applications, but (1) I donโt want to start a second external process and (2) even embedding a message broker inside the same JVM process seems a bit โthe hardestโ for this requirement.
Does anyone know of any well-supported future library that provides this functionality?
Rgds
source share