heesung-sn commented on code in PR #1208: URL: https://github.com/apache/pulsar-client-go/pull/1208#discussion_r1571120345
########## pulsar/consumer_partition.go: ########## @@ -1358,10 +1358,13 @@ func createEncryptionContext(msgMeta *pb.MessageMetadata) *EncryptionContext { return &encCtx } -func (pc *partitionConsumer) ConnectionClosed() { +func (pc *partitionConsumer) ConnectionClosed(closeConsumer *pb.CommandCloseConsumer) { // Trigger reconnection in the consumer goroutine pc.log.Debug("connection closed and send to connectClosedCh") - pc.connectClosedCh <- connectionClosed{} + pc.connectClosedCh <- &connectionClosed{ Review Comment: Can we pass one of them only by checking if tls is enabled or not here? I think we better pass one arg to the downstream funcs to simplify. (same for CommandCloseProducer) ########## pulsar/producer_partition.go: ########## @@ -221,14 +221,25 @@ func newPartitionProducer(client *client, topic string, options *ProducerOptions return p, nil } -func (p *partitionProducer) grabCnx() error { - lr, err := p.client.lookupService.Lookup(p.topic) +func (p *partitionProducer) lookupTopic(brokerURL, brokerURLTLS string) (*internal.LookupResult, error) { + if len(brokerURL) == 0 && len(brokerURLTLS) == 0 { Review Comment: can we move this logic to `lookupService.GetBrokerAddress` to reuse? (Then maybe we need to pass additionally pass topicName to GetBrokerAddress) ########## pulsar/internal/lookup_service.go: ########## @@ -284,12 +291,24 @@ type httpLookupService struct { metrics *Metrics } -func (h *httpLookupService) getBrokerAddress(ld *httpLookupData) (logicalAddress *url.URL, +func (h *httpLookupService) GetBrokerAddress(brokerServiceURL, brokerServiceURLTls string, Review Comment: As I commented, can we pass one of these(brokerServiceURL, brokerServiceURLTls)? -- 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-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org