advantageous / qbit

The Java microservice lib. QBit is a reactive programming lib for building microservices - JSON, HTTP, WebSocket, and REST. QBit uses reactive programming to build elastic REST, and WebSockets based cloud friendly, web services. SOA evolved for mobile and cloud. ServiceDiscovery, Health, reactive StatService, events, Java idiomatic reactive programming for Microservices.
http://advantageous.github.io/qbit/
Apache License 2.0
709 stars 140 forks source link

What is the recommended way to shutdown a queue and await completion? #790

Open jeacott1 opened 6 years ago

jeacott1 commented 6 years ago

if I have a queue:

        final QueueBuilder queueBuilder = QueueBuilder.queueBuilder();

        queue = queueBuilder.setArrayBlockingQueue().setBatchSize(1000).setLimit(50)
                .setCheckEvery(5).setCheckIfBusy(false)
                .setName("Bridge Queue").setPollTimeUnit(TimeUnit.MILLISECONDS)
                .setPollWait(50).build();

        receiveQueue = queue.receiveQueue();
        sendQueue = queue.sendQueue();

calling queue.stop() looks like it will just exit processing, without first shutting down the sendQueue and allowing the receiveQueue to finish processing.

the internal queue and hence peek method is not available, so how is it intended that I can effect something like a queue.shutdownAwaitCompletion(timeout) ?

thanks.