Asynchronous ElasticSearch API

Want to write integration tests for the elasticSearch service:
1. Index
2. Search
3. Check the result

Each Java api method runs asynchronously. How can I do this as a simple sync api: call api.a , waiting for a result, calling api.b , waiting for a result ...

+4
source share
1 answer

As @loteq mentioned, you can just call .actionGet() on Future to make it synchronous. Check elasticsearch integration tests , they have very good examples.

+4
source

Source: https://habr.com/ru/post/957374/


All Articles