I have a distributed Hazelcast map (IMap) which is potentially very large.
I am tasked with returning the ENTIRE map values() collection as response to an HTTP GET request.
To minimise heap utilisation I plan to use Spring WebFlux and return an instance of Flux.
My concern is that invocation of IMap#values().iterator().next(), which is implicit in Flux.fromIterable(), might deserialize ALL values from ALL cluster members, thus blowing the heap of the JVM which is a Hazelcast client servicing the GET request.
If this concern is well-founded, then:
Would Hazelcast Jet provide a solution? I could create a Pipeline.withSource(IMap), but how would I create the sink as an instance of Flux which can be returned?
Many thanks, Robin.