xujianhai666 commented on a change in pull request #106: [ISSUE #105] Add
PullConsumer. resolve #105
URL: https://github.com/apache/rocketmq-client-go/pull/106#discussion_r301901945
##########
File path: consumer/push_consumer.go
##########
@@ -126,20 +126,18 @@ func (pc *pushConsumer) Start() error {
pc.state = internal.StateStartFailed
pc.validate()
- if pc.model == Clustering {
- // set retry topic
- retryTopic := internal.GetRetryTopic(pc.consumerGroup)
- pc.subscriptionDataTable.Store(retryTopic,
buildSubscriptionData(retryTopic,
- MessageSelector{TAG, _SubAll}))
+ err = pc.defaultConsumer.start()
+ if err != nil {
+ return
}
- pc.client =
internal.GetOrNewRocketMQClient(pc.option.ClientOptions)
- if pc.model == Clustering {
- pc.option.ChangeInstanceNameToPID()
- pc.storage = NewRemoteOffsetStore(pc.consumerGroup,
pc.client)
- } else {
- pc.storage = NewLocalFileOffsetStore(pc.consumerGroup,
pc.client.ClientID())
+ err := pc.client.RegisterConsumer(pc.consumerGroup, pc)
+ if err != nil {
+ pc.state = internal.StateCreateJust
Review comment:
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:
[email protected]
With regards,
Apache Git Services