[frs-367] Application Naming

In FusionReactor 6.0.0 we have added the ability to name the Application for each web request. This feature allows for a greater break down of requests by each application. There are many different ways to name the application and FusionReactor will automatically try all options, however there is a priority order.

Naming Priority

  1. FRAPI.setTransactionApplicationName
  2. Request attribute (fr.application.name)
  3. Middleware server (e.g.CFAPPLICATION)
  4. Servlet init parameter (fr.application.name)
  5. Filter init parameter (fr.application.name)
  6. Web app context parameter (fr.application.name)
  7. Web app context name (display-name)
  8. Web app servlet context path
  9. The Default Application Name

Default Name

In the event that FusionReactor is unable to detect the name of the application via any of the options above (or if the automatic application naming is disabled), it will default to name set as the default. This is set in the FusionReactor -> Settings page (http://docs.intergral.com/display/FR60/Settings).

Manual Naming


If you want to override the automatic naming detected by FusionReactor you can set the name for the application using request attributes of parameters at different levels (context, filter and servlet). In all cases the key used is fr.application.name.

Web App Context Parameter

To set the application name used by FusionReactor as a context parameter, edit the web.xml file and add the following code block.

Context Parameter
<context-param>
    <param-name>fr.application.name</param-name>
    <param-value>JSP Test App</param-value>
</context-param>

Filter Parameter

To set the application name used by FusionReactor as a filter init parameter, edit the filter configuration and add the property fr.application.name with the value being the name of the application. This can be done via the web.xml adding the parameter to the filter definition.

Filter Init Parameter
<filter>
    <filter-name>Filter3</filter-name>
    <filter-class>com.intergral.test.fusionreactor.filters.Filter3</filter-class>
    <init-param>
        <param-name>fr.application.name</param-name>
        <param-value>Application Name</param-value>
    </init-param>
</filter>

Servlet Parameter

Similar to the filter parameter settings you can set the application name for FusionReactor to use as a servlet init parameter. This is also done via the web.xml file.

Servlet Init Parameter
<servlet>
    <servlet-name>Servlet2</servlet-name>
    <servlet-class>com.intergral.fusionreactor.servlets.Servlet2</servlet-class>
    <init-param>
        <param-name>fr.application.name</param-name>
        <param-value>Application Name</param-value>
    </init-param>
</servlet>

Request Attribute

To set the application name with a request attribute simply add the attribute to the request object. FusionReactor will then use this attribute as the application name when the request is complete. This approach will only affect the requests where this attribute is set.

Request Attribute
    request.setAttribute("fr.application.name", "Application Name");

FRAPI Call

To set the application name with the FusionReactor API (FRAPI) you simply need to call the appropriate method within your code. This method of setting the application name takes precedence over all other methods, however it will only affect the single request where this method is called.

Request Attribute
    FRAPI.getFRAPI().setTransactionApplicationName("Application Name");

Automatic Naming


FusionReactor will automatically name applications using a few different ways, FusionReactor will try all of these methods without needing any additional settings.

Middleware Server

With some application servers it is possible to set the name of the application in the code. For example in Coldfusion you can set the name of the application using the <CFAPPLICATION> tag.

CFApplication tag
<cfapplication name=CF App>

Web App Context Name

The most common name will become the application context name. This name is defined in the web.xml for the application, using the display-name element.

Context Display name
<display-name>JSP Test Application</display-name>

Web App Context path

The last resort for the application name before it becomes the default is to use the context path for the application. This is the root of the URL for the application.

This image shows the URL for the Apache Tomcat Manager app, where the context paht is /manager.

Issue Details

Type: Technote
Issue Number: FRS-367
Components: FRAPI
Environment:
Resolution: Fixed
Last Updated: 01/Dec/15 11:33 AM
Affects Version:
Fixed Version: 6.0.0
Server:
Platform:
Related Issues:

FRS-368: Transaction Naming

Comments are closed.