949808802 opened a new issue #10826:
URL: https://github.com/apache/pulsar/issues/10826


   **Describe the bug**
   key_share mode comsumber Could not get connection to broker
   
   **To Reproduce**
   I user key_share mode,but comsumer could not get connection to broker,but i 
use exclusive,failover,share can connect to broker.
   I user 3 zk,3bookeeper,3 broker.
   
   code:
    public static void main(String[] args)throws Exception{
           Consumer<String> keyShareConsumer1 = 
GetPulsarClient.get().newConsumer(Schema.STRING)
                   .topic("persistent://my-tenant/my-namespace/my-topic")
                   .subscriptionName("key-share-subscription")
                   .subscriptionType(SubscriptionType.Key_Shared)
                   .subscribe();
           while (true) {
               Message<String> message = keyShareConsumer1.receive();
               try {
                   System.out.println("keyShareConsumer1 received key: 
"+message.getKey()+" ,message:"+ message.getValue());
                   keyShareConsumer1.acknowledge(message);
               }catch (Exception e) {
                   System.out.println(e);
                   keyShareConsumer1.negativeAcknowledge(message);
               }
           }
       }
   Change subscriptionType can connect to broker.
   I don't know what went wrong
   
   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to