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 2022/03/23 10:14:40 UTC

[GitHub] [pulsar] liangjianwen commented on issue #14817: [2.8.1]In Geo-Replication, "Failover" mode subscriptions consume messages repeatedly.

liangjianwen commented on issue #14817:
URL: https://github.com/apache/pulsar/issues/14817#issuecomment-1076190352


   
   
   
   > Set consumer `replicateSubscriptionState=true`, eg :
   > 
   > ```
   > pulsarClient.newConsumer()
   >                 .topic(topic)
   >                 .subscriptionName(xxx)
   >                 .replicateSubscriptionState(true)
   >                 .subscribe()
   > ```
   
   My code is already like this. But still doesn't work correctly.  Below is my code:
   ```
   PulsarClient pulsarClient = PulsarClient.builder().serviceUrl(url).statsInterval(1, TimeUnit.SECONDS).build();
           Consumer consumer = pulsarClient.newConsumer()
                   .topic(topic)
                   .subscriptionName(subscriptionName)
                   .subscriptionType(SubscriptionType.Failover)
                   .receiverQueueSize(1000)
                   .ackTimeout(30,TimeUnit.SECONDS)
                   .replicateSubscriptionState(true)
                   .subscribe();
   ```
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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