taiyang-li opened a new issue #318:
URL: https://github.com/apache/pulsar-client-go/issues/318
#### Expected behavior
Messages are consumed at least once when reopen consumer.
#### Actual behavior
Some messages are missing when reopen consumer
#### Steps to reproduce
Producer: send 10k message per batch, every message in on batch has the
same timestamp.
Producer code:
``` go
func main() {
if len(os.Args) < 2 {
log.Fatal("./$0 speed")
}
speed, err := strconv.Atoi(os.Args[1])
if err != nil {
log.Fatal(err)
}
client, err := pulsar.NewClient(pulsar.ClientOptions{
URL: "pulsar://146.196.79.231:6650",
})
if err != nil {
log.Fatal(err)
}
defer client.Close()
producer, err := client.CreateProducer(pulsar.ProducerOptions{
Topic: "persistent://imo/cluster2-gray/ck_test_v2",
})
if err != nil {
log.Fatal(err)
}
defer producer.Close()
for {
t := time.Now().Unix()
for i := 0; i < speed; i++ {
msg := fmt.Sprintf(`{"number": "%d" , "time": %d}`, i,
t*1000)
producer.Send(context.Background(),
&pulsar.ProducerMessage{
Payload: []byte(msg),
})
}
time.Sleep(time.Second)
}
}
```
Run producer
``` bash
go build -o send_to_pulsar
./send_to_pulsar 10000
```
consumer:
```
```
result:
#### System configuration
pulsar 2.5.1
pulsar-client-go v0.1.1
----------------------------------------------------------------
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:
[email protected]