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 2020/09/24 09:15:36 UTC

[GitHub] [rocketmq-client-go] happyxhw opened a new issue #537: Is there any way to unsubscribe ?

happyxhw opened a new issue #537:
URL: https://github.com/apache/rocketmq-client-go/issues/537


   ```
   func (pc *pushConsumer) Unsubscribe(string) error {
   	return nil
   }
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-go] happyxhw edited a comment on issue #537: Is there any way to unsubscribe ?

Posted by GitBox <gi...@apache.org>.
happyxhw edited a comment on issue #537:
URL: https://github.com/apache/rocketmq-client-go/issues/537#issuecomment-698233461


   shutdown the consumer,, then the producer can not push anymore
   ```
   p, err := rocketmq.NewProducer(
   		producer.WithNameServer(primitive.NamesrvAddr{endpoint}),
   		producer.WithRetry(3),
   		producer.WithGroupName(group),
   	)
   	if err != nil {
   		log.Fatal("start producer err", zap.Error(err))
   	}
   	err = p.Start()
   	if err != nil {
   		log.Fatal("start producer err", zap.Error(err))
   	}
   	for i := 0; i < 10000; i++ {
   		err := p.SendOneWay(context.Background(), &primitive.Message{
   			Topic: topic,
   			Body:  []byte("Hello RocketMQ Go Client!"),
   		})
   		if err != nil {
   			log.Error("push err", zap.Error(err))
   		}
   		time.Sleep(time.Second * 1)
   	}
   ```
   shutdown consumer push err:
   ```
   "service close is not running, please check"
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-go] happyxhw edited a comment on issue #537: Is there any way to unsubscribe ?

Posted by GitBox <gi...@apache.org>.
happyxhw edited a comment on issue #537:
URL: https://github.com/apache/rocketmq-client-go/issues/537#issuecomment-698233461


   shutdown the consumer,, then the producer can not push anymore
   ```
   p, err := rocketmq.NewProducer(
   		producer.WithNameServer(primitive.NamesrvAddr{endpoint}),
   		producer.WithRetry(3),
   		producer.WithGroupName(group),
   	)
   if err != nil {
   	log.Fatal("start producer err", zap.Error(err))
   }
   err = p.Start()
   if err != nil {
   	log.Fatal("start producer err", zap.Error(err))
   }
   for i := 0; i < 10000; i++ {
   	err := p.SendOneWay(context.Background(), &primitive.Message{
   		Topic: topic,
   		Body:  []byte("Hello RocketMQ Go Client!"),
   	})
   	if err != nil {
   		log.Error("push err", zap.Error(err))
   	}
   	time.Sleep(time.Second * 1)
   }
   ```
   shutdown consumer, then push err:
   ```
   "service close is not running, please check"
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-go] happyxhw edited a comment on issue #537: Is there any way to unsubscribe ?

Posted by GitBox <gi...@apache.org>.
happyxhw edited a comment on issue #537:
URL: https://github.com/apache/rocketmq-client-go/issues/537#issuecomment-698233461


   shutdown the consumer,, then the producer can not push anymore
   ```
   p, err := rocketmq.NewProducer(
   		producer.WithNameServer(primitive.NamesrvAddr{endpoint}),
   		producer.WithRetry(3),
   		producer.WithGroupName(group),
   	)
   if err != nil {
   	log.Fatal("start producer err", zap.Error(err))
   }
   err = p.Start()
   if err != nil {
   	log.Fatal("start producer err", zap.Error(err))
   }
   for i := 0; i < 10000; i++ {
   	err := p.SendOneWay(context.Background(), &primitive.Message{
   		Topic: topic,
   		Body:  []byte("Hello RocketMQ Go Client!"),
   	})
   	if err != nil {
   		log.Error("push err", zap.Error(err))
   	}
   	time.Sleep(time.Second * 1)
   }
   ```
   shutdown consumer, then push err:
   ```
   // 停止订阅
   func (c Consumer) unSubscribe() {
   	log.Info("unsubscribe ...")
   	if err := c.consumer.Shutdown(); err != nil {
   		log.Error("failed to shutdown", zap.Error(err))
   	}
   	time.Sleep(time.Second * 5)
   }
   ```
   ```
   "service close is not running, please check"
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-go] maixiaohai closed issue #537: Is there any way to unsubscribe ?

Posted by GitBox <gi...@apache.org>.
maixiaohai closed issue #537:
URL: https://github.com/apache/rocketmq-client-go/issues/537


   


-- 
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:
users@infra.apache.org



[GitHub] [rocketmq-client-go] happyxhw edited a comment on issue #537: Is there any way to unsubscribe ?

Posted by GitBox <gi...@apache.org>.
happyxhw edited a comment on issue #537:
URL: https://github.com/apache/rocketmq-client-go/issues/537#issuecomment-698233461






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-go] happyxhw edited a comment on issue #537: Is there any way to unsubscribe ?

Posted by GitBox <gi...@apache.org>.
happyxhw edited a comment on issue #537:
URL: https://github.com/apache/rocketmq-client-go/issues/537#issuecomment-698233461


   shutdown the consumer,, then the producer can not push anymore
   ```
   p, err := rocketmq.NewProducer(
   		producer.WithNameServer(primitive.NamesrvAddr{endpoint}),
   		producer.WithRetry(3),
   		producer.WithGroupName(group),
   	)
   if err != nil {
   	log.Fatal("start producer err", zap.Error(err))
   }
   err = p.Start()
   if err != nil {
   	log.Fatal("start producer err", zap.Error(err))
   }
   for i := 0; i < 10000; i++ {
   	err := p.SendOneWay(context.Background(), &primitive.Message{
   		Topic: topic,
   		Body:  []byte("Hello RocketMQ Go Client!"),
   	})
   	if err != nil {
   		log.Error("push err", zap.Error(err))
   	}
   	time.Sleep(time.Second * 1)
   }
   ```
   shutdown consumer, then push err:
   ```
   // unSubscribe
   func (c Consumer) unSubscribe() {
   	log.Info("unsubscribe ...")
   	if err := c.consumer.Shutdown(); err != nil {
   		log.Error("failed to shutdown", zap.Error(err))
   	}
   	time.Sleep(time.Second * 5)
   }
   ```
   ```
   "service close is not running, please check"
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-go] happyxhw edited a comment on issue #537: Is there any way to unsubscribe ?

Posted by GitBox <gi...@apache.org>.
happyxhw edited a comment on issue #537:
URL: https://github.com/apache/rocketmq-client-go/issues/537#issuecomment-698233461


   shutdown the consumer,, then the producer can not push anymore
   ```
   p, err := rocketmq.NewProducer(
   		producer.WithNameServer(primitive.NamesrvAddr{endpoint}),
   		producer.WithRetry(3),
   		producer.WithGroupName(group),
   	)
   if err != nil {
   	log.Fatal("start producer err", zap.Error(err))
   }
   err = p.Start()
   if err != nil {
   	log.Fatal("start producer err", zap.Error(err))
   }
   for i := 0; i < 10000; i++ {
   	err := p.SendOneWay(context.Background(), &primitive.Message{
   		Topic: topic,
   		Body:  []byte("Hello RocketMQ Go Client!"),
   	})
   	if err != nil {
   		log.Error("push err", zap.Error(err))
   	}
   	time.Sleep(time.Second * 1)
   }
   ```
   shutdown consumer push err:
   ```
   "service close is not running, please check"
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-go] happyxhw commented on issue #537: Is there any way to unsubscribe ?

Posted by GitBox <gi...@apache.org>.
happyxhw commented on issue #537:
URL: https://github.com/apache/rocketmq-client-go/issues/537#issuecomment-698233461


   shutdown the consumer,, then the producer can not push anymore
   ```
   "service close is not running, please check"
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [rocketmq-client-go] happyxhw commented on issue #537: Is there any way to unsubscribe ?

Posted by GitBox <gi...@apache.org>.
happyxhw commented on issue #537:
URL: https://github.com/apache/rocketmq-client-go/issues/537#issuecomment-698233461


   shutdown the consumer,, then the producer can not push anymore
   ```
   "service close is not running, please check"
   ```


----------------------------------------------------------------
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:
users@infra.apache.org