Skip to content

Commit 0dc7134

Browse files
authored
Merge pull request #79 from replicase/fix/fix-nil-pulsar-client-issue
2 parents 1c7bef1 + aee7aa0 commit 0dc7134

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/source/pulsar.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ func (p *PulsarConsumerSource) getConsumerName() (string, error) {
178178
if p.ConsumerName != "" {
179179
return p.ConsumerName, nil
180180
}
181+
181182
hostname, err := os.Hostname()
182183
if err != nil {
183184
return "", err
@@ -191,6 +192,11 @@ func (p *PulsarConsumerSource) Capture(cp cursor.Checkpoint) (changes chan Chang
191192
return nil, err
192193
}
193194

195+
p.client, err = pulsar.NewClient(p.PulsarOption)
196+
if err != nil {
197+
return nil, err
198+
}
199+
194200
p.consumer, err = p.client.Subscribe(pulsar.ConsumerOptions{
195201
Name: consumerName,
196202
Topic: p.PulsarTopic,

0 commit comments

Comments
 (0)