Giter VIP home page Giter VIP logo

According to the test code on the official website, I can only listen to the message of the set duration. After this duration, the thread will exit. How to keep the thread running in the background about hstream HOT 9 CLOSED

xiaobaxiang avatar xiaobaxiang commented on May 27, 2024
According to the test code on the official website, I can only listen to the message of the set duration. After this duration, the thread will exit. How to keep the thread running in the background

from hstream.

Comments (9)

daleiz avatar daleiz commented on May 27, 2024

Just don't call consumer.awaitTerminated(5, SECONDS) in the example.

After call consumer.startAsync, the consumer will keep running in the background until you call consumer.stopAsync.

For more details, see https://javadoc.io/doc/com.google.guava/guava/latest/com/google/common/util/concurrent/Service.html

from hstream.

xiaobaxiang avatar xiaobaxiang commented on May 27, 2024

Just don't call consumer.awaitTerminated(5, SECONDS) in the example.

After call consumer.startAsync, the consumer will keep running in the background until you call consumer.stopAsync.

For more details, see https://javadoc.io/doc/com.google.guava/guava/latest/com/google/common/util/concurrent/Service.html

After commenting consumer.awaitTerminated(5, SECONDS);
I got this error: Exception in thread "DefaultDispatcher-worker-5" Exception in thread "DefaultDispatcher-worker-2" Exception in thread "DefaultDispatcher-worker-1" io. hstream.HStreamDBClientException: io.grpc.StatusException: UNAVAILABLE: Channel shutdown invoked

from hstream.

daleiz avatar daleiz commented on May 27, 2024

Just don't call consumer.awaitTerminated(5, SECONDS) in the example.
After call consumer.startAsync, the consumer will keep running in the background until you call consumer.stopAsync.
For more details, see https://javadoc.io/doc/com.google.guava/guava/latest/com/google/common/util/concurrent/Service.html

After commenting consumer.awaitTerminated(5, SECONDS); I got this error: Exception in thread "DefaultDispatcher-worker-5" Exception in thread "DefaultDispatcher-worker-2" Exception in thread "DefaultDispatcher-worker-1" io. hstream.HStreamDBClientException: io.grpc.StatusException: UNAVAILABLE: Channel shutdown invoked

This is because your main function finished. You should block the main thread to prevent it exiting at the end of main function, such as call consumer.awaitTerminated() at last.

from hstream.

xiaobaxiang avatar xiaobaxiang commented on May 27, 2024

ok,it is working

from hstream.

xiaobaxiang avatar xiaobaxiang commented on May 27, 2024

After running for a while (probably over an hour), I get this exception.
19:19:04.146 [DefaultDispatcher-worker-3] ERROR io.hstream.impl.ConsumerKtImpl - streamingFetch error:
io.grpc.StatusException: DEADLINE_EXCEEDED: deadline exceeded after 4999.995723700s. [remote_addr=/104.238.133.225:6570]
Is there a place to configure the timeout period on the hstream server?

from hstream.

daleiz avatar daleiz commented on May 27, 2024

After running for a while (probably over an hour), I get this exception. 19:19:04.146 [DefaultDispatcher-worker-3] ERROR io.hstream.impl.ConsumerKtImpl - streamingFetch error: io.grpc.StatusException: DEADLINE_EXCEEDED: deadline exceeded after 4999.995723700s. [remote_addr=/104.238.133.225:6570] Is there a place to configure the timeout period on the hstream server?

We have fixed this issue in hstreamdb-java 0.15.0 and recommend you to update to this version.

from hstream.

xiaobaxiang avatar xiaobaxiang commented on May 27, 2024

I have upgraded hstreamdb-java to 0.15.0, and HStreamDB to the latest(I don't know whether it is v0.15.0 version,No command found to view the Hstream version).The code cannot run, and the exception is recorded in the following log
log.txt。When I switch back to the previous version 0.13.0, it works. But it still exits at 5000 seconds.I think this time is configured in hstreamdb, not in hstream-java.

from hstream.

daleiz avatar daleiz commented on May 27, 2024

I have upgraded hstreamdb-java to 0.15.0, and HStreamDB to the latest(I don't know whether it is v0.15.0 version,No command found to view the Hstream version).The code cannot run, and the exception is recorded in the following log log.txt。When I switch back to the previous version 0.13.0, it works. But it still exits at 5000 seconds.I think this time is configured in hstreamdb, not in hstream-java.

Do you repull the latest docker image of hstreamdb ? To be clear, we recommend to use hstreamdb 0.15.
We have tested hstreamdb-java 0.15.0 against hstreamdb 0.15 and the latest, and they work well.

Regarding the consumer's timeout, it is indeed set on the java client side, and in 0.15 the consumer is set to never time out unless it is stopped.

from hstream.

xiaobaxiang avatar xiaobaxiang commented on May 27, 2024

ok,it is working now

from hstream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.