You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/12/23 12:20:51 UTC

[GitHub] [pulsar-client-go] dsmlily opened a new issue #140: consumer is closed, but consumer.Recieve() is blocked instead of throwing an exception

dsmlily opened a new issue #140: consumer is closed, but consumer.Recieve() is blocked instead of throwing an exception
URL: https://github.com/apache/pulsar-client-go/issues/140
 
 
   
           client, err := pulsar.NewClient(pulsar.ClientOptions{URL: "pulsar://localhost:6650"})
   	if err != nil {
   		log.Fatal(err)
   	}
   
   	defer client.Close()
   
   	consumer, err := client.Subscribe(pulsar.ConsumerOptions{
   		Topic:            "topic1",
   		SubscriptionName: "my-sub",
   		Type:             pulsar.Shared,
   	})
   	if err != nil {
   		log.Fatal(err)
   	}
   
   	if err := consumer.Unsubscribe(); err != nil {
   		log.Fatal(err)
   	} 
   	consumer.Close()
   
   	for  {
   		fmt.Printf("receive msg ...")
   		msg, err := consumer.Receive(context.Background())
   		if err != nil {
   			log.Fatal(err)
   		}
   
   		fmt.Printf("Received message msgId: %#v -- content: '%s'\n",
   			msg.ID(), string(msg.Payload()))
   
   		consumer.Ack(msg)
   	}
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [pulsar-client-go] wolfstudy closed issue #140: consumer is closed, but consumer.Recieve() is blocked instead of throwing an exception

Posted by GitBox <gi...@apache.org>.
wolfstudy closed issue #140: consumer is closed, but consumer.Recieve() is blocked instead of throwing an exception
URL: https://github.com/apache/pulsar-client-go/issues/140
 
 
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [pulsar-client-go] wolfstudy commented on issue #140: consumer is closed, but consumer.Recieve() is blocked instead of throwing an exception

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #140: consumer is closed, but consumer.Recieve() is blocked instead of throwing an exception
URL: https://github.com/apache/pulsar-client-go/issues/140#issuecomment-568674784
 
 
   @dsmlily The issue has been fixed, will close it.

----------------------------------------------------------------
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


With regards,
Apache Git Services