fix(transaction): Execute traceparent before the transaction processor to use the trace value as the transaction id
Closes gravitee-io/issues#4212
@@ -50,11 +50,14 @@ public class RequestProcessorChainFactory implements InitializingBean {
@Override
public void afterPropertiesSet() throws Exception {
providers.add(new ProcessorSupplier<>(XForwardForProcessor::new));
- providers.add(new ProcessorSupplier<>(() -> transactionHandlerFactory.create()));
+ // Trace context is executed before the transaction to ensure that we can use the traceparent span value as the
+ // transaction ID
if (traceContext) {
providers.add(new ProcessorSupplier<>(() -> traceContextHandlerFactory.create()));
}
+
+ providers.add(new ProcessorSupplier<>(() -> transactionHandlerFactory.create()));
}
public Processor<ExecutionContext> create() {
