[GitHub] [pulsar-client-go] xujianhai666 commented on a change in pull request #69: [ISSUE #68][feat]add Option config for init (#68)
xujianhai666 commented on a change in pull request #69: [ISSUE #68][feat]add Option config for init (#68) URL: https://github.com/apache/pulsar-client-go/pull/69#discussion_r342892994 ## File path: examples/consumer-listener/consumer-listener.go ## @@ -34,15 +34,9 @@ func main() { channel := make(chan pulsar.ConsumerMessage, 100) - options := pulsar.ConsumerOptions{ - Topic:"topic-1", - SubscriptionName: "my-subscription", - Type: pulsar.Shared, - } - - options.MessageChannel = channel - - consumer, err := client.Subscribe(options) + consumer, err := client.Subscribe("my-subscription", pulsar.WithTopics("topic-1"), + pulsar.WithSubscriptionType(pulsar.Shared), + pulsar.WithMessageChannel(channel)) Review comment: @merlimat I know ur question, we could use WithSybcriptionName to expose the set of subcription name. 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 With regards, Apache Git Services
[GitHub] [pulsar-client-go] xujianhai666 commented on a change in pull request #69: [ISSUE #68][feat]add Option config for init (#68)
xujianhai666 commented on a change in pull request #69: [ISSUE #68][feat]add Option config for init (#68) URL: https://github.com/apache/pulsar-client-go/pull/69#discussion_r342892667 ## File path: README.md ## @@ -79,17 +75,11 @@ fmt.Println("Published message") Create a Consumer: ```go -client, err := pulsar.NewClient(pulsar.ClientOptions{ -URL: "pulsar://localhost:6650", -}) +client, err := pulsar.NewClient("pulsar://localhost:6650") defer client.Close() -consumer, err := client.Subscribe(pulsar.ConsumerOptions{ -Topic:"my-topic", -SubscriptionName: "my-sub", -Type: pulsar.Shared, -}) +consumer, err := client.Subscribe("my-sub", WithTopics("my-topic"), WithSubscriptionType(Shared)) Review comment: topic has three different form: single topic, topic list as well as topic pattern, topic pattern is different from single topic or topic list, so I need methods: WithTopics and WithTopicPattern to distinguish. 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 With regards, Apache Git Services
[GitHub] [pulsar-client-go] xujianhai666 commented on a change in pull request #69: [ISSUE #68][feat]add Option config for init (#68)
xujianhai666 commented on a change in pull request #69: [ISSUE #68][feat]add Option config for init (#68) URL: https://github.com/apache/pulsar-client-go/pull/69#discussion_r342892721 ## File path: README.md ## @@ -79,17 +75,11 @@ fmt.Println("Published message") Create a Consumer: ```go -client, err := pulsar.NewClient(pulsar.ClientOptions{ -URL: "pulsar://localhost:6650", -}) +client, err := pulsar.NewClient("pulsar://localhost:6650") defer client.Close() -consumer, err := client.Subscribe(pulsar.ConsumerOptions{ -Topic:"my-topic", -SubscriptionName: "my-sub", -Type: pulsar.Shared, -}) +consumer, err := client.Subscribe("my-sub", WithTopics("my-topic"), WithSubscriptionType(Shared)) Review comment: @merlimat topic has three different form: single topic, topic list as well as topic pattern, topic pattern is different from single topic or topic list, so I need methods: WithTopics and WithTopicPattern to distinguish. 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 With regards, Apache Git Services
[GitHub] [pulsar-client-go] xujianhai666 commented on a change in pull request #69: [ISSUE #68][feat]add Option config for init (#68)
xujianhai666 commented on a change in pull request #69: [ISSUE #68][feat]add Option config for init (#68) URL: https://github.com/apache/pulsar-client-go/pull/69#discussion_r342892667 ## File path: README.md ## @@ -79,17 +75,11 @@ fmt.Println("Published message") Create a Consumer: ```go -client, err := pulsar.NewClient(pulsar.ClientOptions{ -URL: "pulsar://localhost:6650", -}) +client, err := pulsar.NewClient("pulsar://localhost:6650") defer client.Close() -consumer, err := client.Subscribe(pulsar.ConsumerOptions{ -Topic:"my-topic", -SubscriptionName: "my-sub", -Type: pulsar.Shared, -}) +consumer, err := client.Subscribe("my-sub", WithTopics("my-topic"), WithSubscriptionType(Shared)) Review comment: topic has three different form: single topic, topic list as well as topic pattern, topic pattern is different from single topic or topic list, so I need methods: WithTopics and WithTopicPattern to distinguish. 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 With regards, Apache Git Services
[GitHub] [pulsar-client-go] xujianhai666 commented on a change in pull request #69: [ISSUE #68][feat]add Option config for init (#68)
xujianhai666 commented on a change in pull request #69: [ISSUE #68][feat]add Option config for init (#68) URL: https://github.com/apache/pulsar-client-go/pull/69#discussion_r334224839 ## File path: README.md ## @@ -60,9 +60,7 @@ client, err := pulsar.NewClient(pulsar.ClientOptions{ defer client.Close() -producer, err := client.CreateProducer(pulsar.ProducerOptions{ - Topic: "my-topic", -}) +producer, err := client.CreateProducer("my-topic") Review comment: @wolfstudy done 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 With regards, Apache Git Services