You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "davendu (via GitHub)" <gi...@apache.org> on 2023/11/30 12:06:59 UTC

Re: [I] Add context param in interceptor [pulsar-client-go]

davendu commented on issue #443:
URL: https://github.com/apache/pulsar-client-go/issues/443#issuecomment-1833642431

   +1 for Golang client supporting context in conceptor. Besides tracing purpose, we internally use context to trace process of a message, and change properties based on some value. Currently we have to wrap the producer to modify Send & SendAsync. It can be better implemented if interceptor supports context.
   
   #505 is closed since tracing is already supported in #518, but I think adding context is still necessary for Golang client. In other languages like Java and C++, execution context is implicitly shared (for example, using TLS variable). However, Golang requires explicit share of state, thus having `context.Context` type. For now, there is no way to share state (other than some [hack](https://github.com/jtolio/gls)) between caller and interceptor.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org