Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Any support for Reactive streams / RxJava integration or non-blocking alternative? #392

Closed
dfernandezm opened this issue Dec 4, 2017 · 1 comment

Comments

@dfernandezm
Copy link

Hi all,

Sorry if this is a dumb question, I am a beginner in InfluxDB and this library. I would like to invoke it for a high volume of input coming from a Java application. That application will use RxJava / Reactive Streams all the way, so it is completely non-blocking.
Is it supported at all? Any pointers to a possible wrapping of the current calls so that they are observables or equivalent?

@dfernandezm dfernandezm changed the title Support for Reactive streams / RxJava integration or non-blocking alternative Question: Any support for Reactive streams / RxJava integration or non-blocking alternative? Dec 4, 2017
@fmachado
Copy link
Contributor

fmachado commented Dec 17, 2017

@dfernandezm IMO there is a feasible approach for reactive streams with the current API. However it's important to notice that it may not be the best solution and the API will probably be rewritten soon (for a more complete overview about existing issues, check this document).

I'm assuming that you want to write as may points in one HTTP call as possible. So I would:

  1. Enable the batch mode (org.influxdb.impl.InfluxDBImpl.enableBatch(int, int, TimeUnit, ThreadFactory, BiConsumer<Iterable<Point>, Throwable>));
  2. Create a BiConsumer to notify my Observable for errors. Currently we don't have a way to notify on successful writes (this issue is mentioned on the document).

BTW, any contribution here (e.g. a refactoring to support CompletableFuture or another approach that do not add external dependencies) would be great! :)

@dubsky @majst01 what do you guys think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants