MDC Context not propogating
Expected Behavior
MDC context should propogate to Temporal Threads with spring boot sdk
Actual Behavior
MDC Context not getting propogated
Steps to Reproduce the Problem
1.Set up MDC Context Propogator in code
- Check logs from Temporal and no MDC context present
Specifications
- Version: temporal-spring-boot-starter-alpha, 1.20.1
- Platform:
Modifying the SpringBoot sample to have a MDC context propagator I had no issue propagating a value from the client or workflow to an Activity.
https://github.com/Quinn-With-Two-Ns/samples-java/commit/c99e24af5f20d1965827c5e178f6541a9b5ddf12
If you can share more details about your setup, ideally in a self contained example, I can try to help narrow down where the error is.
Thanks @Quinn-With-Two-Ns . I do have workflow client bean create like this
@Bean
public WorkflowClient workflowClient(DataConverter dataConverter, MdcContextPropagator mdcContextPropagator) {
WorkflowServiceStubs service = WorkflowServiceStubs.newLocalServiceStubs();
WorkflowClientOptions workflowClientOptions = WorkflowClientOptions.newBuilder().setDataConverter(dataConverter).setContextPropagators(Collections.singletonList(mdcContextPropagator)).build();
return WorkflowClient.newInstance(service, workflowClientOptions);
}
still I donot see MDC context getting propogated
@karunagoyal You need to also be setting the the context propagator on the client the worker uses. You can see how in TemporalOptionsConfig.java in the code I posted.