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/04/26 10:15:47 UTC

[GitHub] [pulsar-client-go] nickmurr opened a new issue #512: Unsubscribe from 1..n topic(s) in multi-topic/regexp subscription

nickmurr opened a new issue #512:
URL: https://github.com/apache/pulsar-client-go/issues/512


   Is there a way to unsubscribe from some topics in multi-topics subscription?
   
   ```go
   consumer, err := pulsarClient.Subscribe(pulsar.ConsumerOptions{
   	Topics:                                 []string{"topic1", "topic2", "topic3"},
           // TopicsPattern:                  "topic*", // or
   	SubscriptionName:             "test-subscription",
   	Type:                                     pulsar.Shared,
   	SubscriptionInitialPosition: pulsar.SubscriptionPositionEarliest,
   })
   
   // TODO
   consumer.UnsubscribeTopic("topic1","topic2")
   consumer.CloseTopic("topic1", "topic2")
   ```
   


-- 
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-client-go] wolfstudy commented on issue #512: Unsubscribe from 1..n topic(s) in multi-topic/regexp subscription

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #512:
URL: https://github.com/apache/pulsar-client-go/issues/512#issuecomment-827279437


   @nickmurr At present, it seems that there is no good way. When you use multi-topics, the system understands that you want to use the same subscription to deal with these topics. If you don’t want to use the same subscription, you can assign these topics Create different subscriptions to deal with.


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