cxf icon indicating copy to clipboard operation
cxf copied to clipboard

Enable replacing the ThreadPoolExecutor implementation

Open ammachado opened this issue 1 year ago • 5 comments

for OpenTelemetry thread context propagation

ammachado avatar Sep 11 '24 18:09 ammachado

Thanks for the change, @ammachado . In CXF, we use bus extensions to provide alternative implementation (fe instrumented ones). For work queue, please use org.apache.cxf.workqueue.WorkQueueManager extension point where you could provide instrumented AutomaticWorkQueue implementation (over the default one, all classes are public). Thank you.

reta avatar Sep 12 '24 23:09 reta

Thanks for the change, @ammachado . In CXF, we use bus extensions to provide alternative implementation (fe instrumented ones). For work queue, please use org.apache.cxf.workqueue.WorkQueueManager extension point where you could provide instrumented AutomaticWorkQueue implementation (over the default one, all classes are public). Thank you.

Can you you provide more details where I can find this extension point?

ammachado avatar Sep 12 '24 23:09 ammachado

Can you you provide more details where I can find this extension point?

Sure, the default extensions come from [1] so you could have your own META-INF/cxf/bus-extensions.txt in application that overrides the default:

org.my.package.InstrumentedWorkQueueManagerImpl:org.apache.cxf.workqueue.WorkQueueManager:true

Upon initialization, the bus manager reads the extensions and initializes them. You could also do this programmatically:

bus.setExtension(org.apache.cxf.workqueue.WorkQueueManager.class, new org.my.package.InstrumentedWorkQueueManagerImpl());

[1] https://github.com/apache/cxf/blob/main/core/src/main/resources/META-INF/cxf/bus-extensions.txt

reta avatar Sep 12 '24 23:09 reta

I'm not sure I understood what you're saying... this PR already have a bus-extensions.txt providing a new WorkQueueManager. Should I remove this and move to my applications?

ammachado avatar Sep 12 '24 23:09 ammachado

Should I remove this and move to my applications?

Exactly, along with desired instrumentation, there are no changes required on CXF side.

reta avatar Sep 13 '24 00:09 reta