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


   **FEATURE REQUEST**
   
   1. Please describe the feature you are requesting.
   I want to pass context into transaction listener `ExecuteLocalTransaction`. 
So it looks like `ExecuteLocalTransaction(context.Context, *Message) 
LocalTransactionState`. This passed context comes from 
`SendMessageInTransaction(ctx context.Context, msg *primitive.Message) 
(*primitive.TransactionSendResult, error)`.
   
     Here're three scenarios for this context usage.
   
   - I want to add jaeger tracing support for everything happening inside 
`ExecuteLocalTransaction`. The jaeger tracing needs to  use a parent context, 
so jaeger can track operations in a tracing life cycle. For example, here's an 
usage example for context inside [mongo 
operation](https://github.com/smiletrl/micro_ecommerce/blob/master/pkg/mongodb/mongodb.go#L59).
 If mongodb has been invoked inside `ExecuteLocalTransaction`, then we can 
track this mongodb operation through the passed context.
   - I want `ExecuteLocalTransaction` to cancel early when the passed context 
has canceled. For example, if there's one long time running sql query inside 
`ExecuteLocalTransaction`, then it should cancel the query if the outer context 
has canceled.
   - I want to pass additional values into `ExecuteLocalTransaction`, like 
[what this issue needs](https://github.com/apache/rocketmq-client-go/issues/668)
   
   2. Provide any additional detail on your proposed use case for this feature.
   see attached patch.
   
   
[local-transaction.txt](https://github.com/apache/rocketmq-client-go/files/6538510/local-transaction.txt)
   
   
   2. Indicate the importance of this issue to you (blocker, must-have, 
should-have, nice-to-have). Are you currently using any workarounds to address 
this issue?
   For scenario three, one workaround is to pass values through the message. 
For scenario 1 and 2, there're no workarounds. It's a blocker for our 
development process. We must need be able to track time consuming tasks inside 
`ExecuteLocalTransaction` through the whole request cycle, and we want to be 
able to cancel long time running tasks inside `ExecuteLocalTransaction` when we 
want.
   
   4. If there are some sub-tasks using -[] for each subtask and create a 
corresponding issue to map to the sub task:
   no nope.
   


-- 
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:
[email protected]


Reply via email to