cfmlprojects / runwar

Other
11 stars 16 forks source link

Set default FusionReactor transaction name for static files #139

Open bdw429s opened 6 years ago

bdw429s commented 6 years ago

When using FusionReactor with CommandBox, static files such as js, css, or jpgs show in the FR UI with the transaction name of "URLRewriteFilter". This is because FR tries to "guess" the name based on the enclosing servlet, which can lead to completely random transaction names based on the servlet filter that happens to be wrapping the request. This is purely a cosmetic thing, but detect if the FR classes are in the classpath and use this code to set the transaction information to something like "Static File" for requests that are being managed by the static file handler and NOT being passed to ColdFusion.

new com.intergral.fusionreactor.api.FRAPI()
  .getInstance()
  .setTransactionName( 'Static File' );

Also, do not just use a try catch, check for the actual class name and cache the check for performance.

bdw429s commented 6 years ago

Thoughts on this? Should be pretty easy and we have a couple clients who could use it.