# What is the recommended way to stream Elasticsearch index data

**URL:** <https://discuss.elastic.co/t/what-is-the-recommended-way-to-stream-elasticsearch-index-data/354426>\
**Category:** Elasticsearch\
**Created:** [February 29, 2024, 10:18am UTC](https://discuss.elastic.co/t/what-is-the-recommended-way-to-stream-elasticsearch-index-data/354426 "2024-02-29T10:18:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![orange.cold256](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orange.cold256/32/113524_2.png) [@orange.cold256](https://discuss.elastic.co/u/orange.cold256)\
**Post date:** [February 29, 2024, 10:18am UTC](https://discuss.elastic.co/t/what-is-the-recommended-way-to-stream-elasticsearch-index-data/354426/1 "2024-02-29T10:18:45Z")

</div>

Good afternoon!

I have a single-node Elasticsearch cluster with a pair of indexes. I'm using Java Spring Boot backend that provides Elasticsearch queries via rest high level client, but I need to provide data streaming somehow.

The point is to provide user with a `application/x-ndjson` or `application/stream+json` stream to be able to see the real-time changes. When a new document is being created / modified I should be able to stream those changes in real time.

As far as I understand, all I need is to use reactive Elasticsearch client with reactive web client, like Webflux to pass the response.

But there are few questions that I can't find answers to:

1. Do I need to modify my current index structure to support reactive behaviour? 2. Are there any official recommendations for data streaming?
2. Would it be possible to handle long-term streams, that could last, for example, for 24 hours?

Would be really appreciated for some links ☺

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 29, 2024, 4:46pm UTC](https://discuss.elastic.co/t/what-is-the-recommended-way-to-stream-elasticsearch-index-data/354426/2 "2024-02-29T16:46:26Z")

</div>

I'd use definitely the new Java client. It has an async version which is IMO designed for that kind of things.

I guess that using the BulkIngester class would help a lot as well to batch a bit your requests.

Have a look at

> <https://github.com/dadoonet/elasticsearch-java-client-demo/blob/main/src/test/java/fr/pilato/test/elasticsearch/hlclient/EsClientIT.java#L407>

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 28, 2024, 4:47pm UTC](https://discuss.elastic.co/t/what-is-the-recommended-way-to-stream-elasticsearch-index-data/354426/3 "2024-03-28T16:47:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
