Skip to content

Rewrite the reactive saveAll(Publisher<T>) methods in template and repository #2496

Closed
@sothawo

Description

@sothawo

Currently the saveAll(Publisher) methods collect the publisher into a list, sending that to Elasticsearch as a batch request and then returning data from the response as Flux.

This needs to be changed to a more reactive approach, as it is not known how many items will be sent in with the publisher.

But we cannot simply just sent each element as a single index request, this would flood the network layer, so we need to

  • buffer the incoming data into batches
  • send this as a bulk request to Elasticsearch
  • use backpressure handling with the upstream publisher to prevent flooding the transport client.
  • provide the returned data in a continous flux.

I outlined the basic idea how this can be done in #2492

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions