Appspy client configuration files

Introduction

The Appspy client side needs 3 configuration files :

  • The collector configuration file : the spring application context file for the Appspy collector.
    • By default, appspy looks for the file : ${appspy-home}/client/conf/appspy-collector-${appspy-mode}.xml
  • The webapp collector part configuration file : the spring application context file for the webapp part of the Appspy collector.
    • By default, appspy looks for the file : ${appspy-home}/client/conf/appspy-webapp-${appspy-mode}.xml
  • The properties file : will be used to substitute the variables defined in the other configuration files (actually : a PropertyPlaceHolder spring).
    • By default, appspy looks for the file : ${appspy-home}/client/conf/appspy-config-${appspy-mode}.properties

The configuration loaders

Those files are loader by a configuration loader. There is one configuration loader for each file.

By default, Appspy uses the org.appspy.client.common.config.FileConfigLoader which look in the Appspy home directory.

You can alternatively use the org.appspy.client.common.config.ClasspathConfigLoader to load one or more files.

This can be achieved by setting the following servlet context parameters :

  • org.appspy.collectorConfigLoader
  • org.appspy.webappConfigLoader
  • org.appspy.propertiesConfigLoader

    Example to load the webapp collector configuration part from the classpath instead of the appspy home directory :

    <context-param>
            <description>Appspy config loader for webapp collector part</description>
            <param-name>org.appspy.webappConfigLoader</param-name>
            <param-value>org.appspy.client.common.config.ClasspathConfigLoader</param-value>
    </context-param>

The configuration file names

You can change the name of the configuration files by setting the following servlet context parameters :

  • org.appspy.propertiesConfigPattern (default is appspy-config-{0}.properties)
  • org.appspy.collectorConfigPattern (default is appspy-collector-{0}.xml)
  • org.appspy.webappConfigPattern (default is appspy-webapp-{0}.xml)

    Where {0} will be replaced at runtime by the value of the system property appspy-mode (default if not set). This is useful if you want to use different configurations (environment code or different collector URL for instance) on different servers.

    Example to load the webapp collector configuration part from the file "my-own-webapp-configuration-file.xml" (independently of the value of the system property appspy-mode) :

    <context-param>
            <description>Appspy config file for webapp collector part</description>
            <param-name>org.appspy.webappConfigPattern</param-name>
            <param-value>my-own-webapp-configuration-file.xml</param-value>
    </context-param>