How to configure JSW¶treqs is managed by JSW (Java Service Wrapper) will allow two major features
- use treqs as a service (treqs status | start | restart | stop)
- run action according to messages sent to console (stdout) like e.g. restart JVM on OutOfMemoryError message.
JSW used a config file named ... wrapper.conf
wrapper.conf is a default config file and should not be changed. It include another config file my-wrapper.conf that should be used to customize behaviour according to the next example :
# Example of my-wrapper.conf # # This file will be included in wrapper.conf (using maven-antrun-plugin) # see pom.xml for details and precautions ! # setting debug level # NONE for no output, # FATAL to only show fatal error messages, (See: Log output to stderr or stdout) # ERROR to show all error messages, (See: Log output to stderr or stdout) # WARN to show all warning messages, (See: Log output to stderr or stdout) # STATUS to show all state changes, # INFO shows all JVM output and informative messages, # DEBUG shows detailed debug information. (See: quickly enable log level "DEBUG") wrapper.debug=TRUE # Maximum number of times that the Wrapper will attempt to restart # the JVM if each attempted invocation exits abnormally or # is restarted shortly after having being launched. # Must be at least 1. The default value is "5 invocations". wrapper.max_failed_invocations=9999 # To restart JVM when OutOfMemoryError occurs on stdout wrapper.filter.trigger.1=java.lang.OutOfMemoryError wrapper.filter.action.1=RESTART # To restart JVM when next message occurs on stdout #wrapper.filter.trigger.2=No staging since a while although there are submitted requests wrapper.filter.trigger.2=Submitted requests found belonging to ended queue wrapper.filter.action.2=RESTART # To restart JVM when next message occurs on stdout wrapper.filter.trigger.3=Dispatcher Stopped wrapper.filter.action.3=RESTART # To restart JVM when next message occurs on stdout wrapper.filter.trigger.4=Activator Stopped wrapper.filter.action.4=RESTART # To restart JVM when next message occurs on stdout wrapper.filter.trigger.5=Stagers Abnormally Stopped wrapper.filter.action.5=RESTART # To restart JVM when next message occurs on stdout wrapper.filter.trigger.6=Watchdog Stopped wrapper.filter.action.6=RESTART # This property controls the number of seconds to pause between # a JVM exiting for any reason, and a new JVM being launched. # The default value is "5 seconds". wrapper.restart.delay=30