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 2021/09/08 10:59:05 UTC

[GitHub] [pulsar-client-go] GPrabhudas opened a new pull request #613: [Issue 443] add context param in producer interceptor

GPrabhudas opened a new pull request #613:
URL: https://github.com/apache/pulsar-client-go/pull/613


   This PR address [issue-443](#443 )
   
   Ability to add properties to message before sending using context param. 
   
   Modified the producer interceptor methods to accept `context` parameter.


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



[GitHub] [pulsar-client-go] cckellogg commented on pull request #613: [Issue 443] add context param in producer interceptor

Posted by GitBox <gi...@apache.org>.
cckellogg commented on pull request #613:
URL: https://github.com/apache/pulsar-client-go/pull/613#issuecomment-921142424


   > ```
   > BeforeSendWithContext(ctx context.Context, producer Producer, message *ProducerMessage)
   > ```
   Adding a new function to the interface will still be a breaking change. Applications will have have to implement the new method and recompile. I think that's what we need to figure out. Do we need to support backward compatibility or is making a breaking api change ok for the next release.
   


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



[GitHub] [pulsar-client-go] wolfstudy commented on pull request #613: [Issue 443] add context param in producer interceptor

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on pull request #613:
URL: https://github.com/apache/pulsar-client-go/pull/613#issuecomment-920929384


   The Logic LGTM +1, as @cckellogg said, maybe we can add a new API for this change, e.g:
   
   ```
   BeforeSendWithContext(ctx context.Context, producer Producer, message *ProducerMessage)
   ```


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



[GitHub] [pulsar-client-go] wolfstudy commented on pull request #613: [Issue 443] add context param in producer interceptor

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on pull request #613:
URL: https://github.com/apache/pulsar-client-go/pull/613#issuecomment-921534388


   > > ```
   > > BeforeSendWithContext(ctx context.Context, producer Producer, message *ProducerMessage)
   > > ```
   > 
   > Adding a new function to the interface will still be a breaking change. Applications will have have to implement the new method and recompile. I think that's what we need to figure out. Do we need to support backward compatibility or is making a breaking api change ok for the next release.
   
   Yes, my mistake. It seems that adding context does have actual usage scenarios and can further improve the processing capabilities of the interceptor itself.
   
   If we want to add this feature without breaking backward compatibility, can we try to directly expose a new interface to the user in ProducerOptions?
   
   For exampels, in `ProducerOptions`:
   
   ```
   // A chain of interceptors with context, These interceptors will be called at some points defined in ProducerInterceptorWithContext interface
   InterceptorsWithContext ProducerInterceptorsWithContext
   ```
   
   and introduce a new interface `ProducerInterceptorsWithContext`:
   
   ```
   type ProducerInterceptorsWithContext interface {
   	BeforeSendWithContext(ctx context.Context,producer Producer, message *ProducerMessage)
   
   	OnSendAcknowledgement(producer Producer, message *ProducerMessage, msgID MessageID)
   }
   ```
   
   But it is not a very elegant way to achieve


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