You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/06/04 08:37:53 UTC

[GitHub] [pulsar] 949808802 opened a new issue #10826: key_share mode comsumber Could not get connection to broker

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:
users@infra.apache.org



[GitHub] [pulsar] 949808802 closed issue #10826: key_share mode comsumber Could not get connection to broker

Posted by GitBox <gi...@apache.org>.
949808802 closed issue #10826:
URL: https://github.com/apache/pulsar/issues/10826


   


-- 
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:
users@infra.apache.org