kjaggann opened a new issue #12370:
URL: https://github.com/apache/pulsar/issues/12370


   the current version of pulsar client: 2.7.3
   the available permit goes to negative .
   
    consumer = pulsarClient.newConsumer()
                       .topic("persistent://xx/xxxx/xxx-1ms")
                       .ackTimeout(60, TimeUnit.SECONDS)
                       .subscriptionName("vmbTest")
   //                    
.subscriptionInitialPosition(SubscriptionInitialPosition.Latest)
                       .batchReceivePolicy(BatchReceivePolicy.builder()
                               .maxNumMessages(100)
                               .maxNumBytes(1024 * 1024)
                               .timeout(1000, TimeUnit.MILLISECONDS)
                               
.build()).subscriptionType(SubscriptionType.Shared)
                       .subscribe();
   
               while (consumer.isConnected()) {
                   Messages<byte[]> batchMessages = consumer.batchReceive();
                   List<String> messages = StreamSupport
                           .stream(batchMessages.spliterator(), false)
                           .map(msg -> String.valueOf(msg.getData()))
                           .collect(Collectors.toList());
   
                   consumer.acknowledge(batchMessages);
               }
               consumer.close();
   
           } catch (PulsarClientException e) {
               if (consumer != null) {
                   consumer.close();
               }
           }
   
   When does the available permit increment again
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to