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 2020/03/16 16:10:12 UTC

[GitHub] [pulsar] zxbfeng commented on issue #6542: Create Producer and Consumer failed

zxbfeng commented on issue #6542: Create Producer and Consumer failed
URL: https://github.com/apache/pulsar/issues/6542#issuecomment-599622968
 
 
   yes, I used the pure go client, and in order to adapt to the inner load balance system I wrappered it. the wrapper file as below.
   [pulsarwrapper.go.txt](https://github.com/apache/pulsar/files/4339053/pulsarwrapper.go.txt)
   
   The Type "SConsumer and SProducer" is the export type, the use of the this type is in a function,like this:
   func  consumeMessage() {
          consumer := plusarwrapper.Consuemer(options)  //this function will create a new consumer ervery time 
          msg, err := consumer.Receive(ctx)
          .........
   }
   
   and the producer is used like the consumer:
   func produceMessage() {
        producer: = pulsarwrapper.Producer(xxxx)
        producer.Send(msg)
   }
   
   PS: in the wrapper, the client will be a global, but the producer and consumer will always create a new one when call function "produceMessage and consumeMessage", so I thought this may casuse the problem, but the error not must appear!!!

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