You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/06/29 10:02:38 UTC
[GitHub] [rocketmq-client-go] inetkiller opened a new issue, #850: consumer does't get message from slave when master broker down
inetkiller opened a new issue, #850:
URL: https://github.com/apache/rocketmq-client-go/issues/850
I used the consumer code from the example, consumer does't get message from slave when master broker down
```
package main
import (
"context"
"fmt"
"os"
"strings"
"time"
"github.com/apache/rocketmq-client-go/v2"
"github.com/apache/rocketmq-client-go/v2/consumer"
"github.com/apache/rocketmq-client-go/v2/primitive"
)
func main() {
nameservers := os.Getenv("NAMESERVERS")
c, _ := rocketmq.NewPushConsumer(
consumer.WithGroupName("testGroup"),
consumer.WithNsResolver(primitive.NewPassthroughResolver(strings.Split(nameservers,","))),
)
err := c.Subscribe("test", consumer.MessageSelector{}, func(ctx context.Context,
msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) {
for i := range msgs {
fmt.Printf("subscribe callback, broker:%s queueID:%d queueMaxOffset:%s queueCurrentOffset:%d \n", msgs[i].StoreHost,msgs[i].Queue.QueueId,msgs[i].GetProperties()["MAX_OFFSET"],msgs[i].QueueOffset)
}
return consumer.ConsumeSuccess, nil
})
if err != nil {
fmt.Println(err.Error())
}
// Note: start after subscribe
err = c.Start()
if err != nil {
fmt.Println(err.Error())
os.Exit(-1)
}
time.Sleep(time.Hour*999)
err = c.Shutdown()
if err != nil {
fmt.Printf("shutdown Consumer error: %s", err.Error())
}
}
```
## Extra info
client version: v2.1.0
RocketMQ version: 4.8.0
--
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: dev-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-client-go] ShannonDing closed issue #850: consumer does't get message from slave when master broker down
Posted by GitBox <gi...@apache.org>.
ShannonDing closed issue #850: consumer does't get message from slave when master broker down
URL: https://github.com/apache/rocketmq-client-go/issues/850
--
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: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-client-go] ShannonDing commented on issue #850: consumer does't get message from slave when master broker down
Posted by GitBox <gi...@apache.org>.
ShannonDing commented on issue #850:
URL: https://github.com/apache/rocketmq-client-go/issues/850#issuecomment-1193961893
link #632
--
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: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org