rmannibucau commented on pull request #810:
URL: https://github.com/apache/cxf/pull/810#issuecomment-854065770


   Hi @andymc12 ,
   
   Seems it works thanks type erasure (Optional<Config> -> Optional).
   
   Also tested with a patched sirona version to ensure it was compliant with a 
javaagent rewriting classes. If of any interest here is what I tested:
   
   . JVM args:
   
       
-javaagent:/opt/rmannibucau/dev/sirona/agent/javaagent/target/sirona-javaagent-0.8-SNAPSHOT-shaded.jar=environment-debug=true|debug=true
   
   . sirona.properties:
       
com.github.rmannibucau.sirona.javaagent.listener.CounterListener.includes=prefix:org.apache.cxf.microprofile.client.config.ConfigFacade
       
com.github.rmannibucau.sirona.javaagent.listener.CounterListener.excludes=container:jvm
       com.github.rmannibucau.sirona.javaagent.path.tracking.activate=false
       com.github.rmannibucau.sirona.logging.counter.clearOnCollect=false
       
   So it looks like it works but I think I still prefer a mp-config indirection 
option - ConfigFacade impl could be bound in the bus as extension - which will 
avoid to go through an exception each time a config is read 
org.apache.cxf.microprofile.client.config.ConfigFacade#config and rely on type 
erasure.
   
   Style side note - I saw it reviewing your PR so thought I could share it:
   
      Optional<Config> c = config();
       return c.isPresent() ? c.get().getOptionalValue(propertyName, clazz) : 
Optional.empty();
   
   should likely be (in most config accessors)
   
       return config().flatMap(c -> c.getOptionalValue(propertyName, clazz));


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