Control dynamic updates
There are three types of dynamic update that can be controlled through configuration: changing the server configuration; adding and removing applications; updating installed applications. For deployed applications, we can configure whether application monitoring is enabled and how often to check for updates to applications. For the "dropins" directory, configure name and location, and choose whether to deploy applications in the directory.
By default, deployed applications are monitored for updates, and the updates are dynamically applied to the running application. This applies both to applications deployed through configuration entries, and those deployed from the "dropins" directory. To change default behavior, set the config and applicationMonitor elements in server.xml. We can use a text editor, or we can use the developer tools and select Configuration Admin Service or Application Monitor in the server configuration design view.
See Configuration elements in server.xml.
The default settings for application monitoring :
<applicationMonitor updateTrigger="polled" pollingRate="500ms" dropins="dropins" dropinsEnabled="true"/>
The updateTrigger property has three possible values:
polled The runtime environment scans server.xml for changes using the timing interval specified by the monitorInterval property. mbean The runtime environment only looks for updates when prompted to do so through a call to an MBean. This is the mode used by the developer tools to update server.xml, unless you override it. disabled The updates are not dynamically applied.
For pollingRate, include the unit of time after the number:
- ms (milliseconds)
- s (seconds)
- m (minutes)
- h (hours)
The dropins property specifies the name of the directory used as the "dropins" directory.
The dropinsEnabled property is a boolean property that determines whether the applications in the "dropins" directory are deployed.
Configure dynamic changes to the server configuration.
Changes to server.xml, or any files it includes, are detected by the runtime environment and applied to the active configuration. We can disable this behavior by setting the config element in server.xml:
<config updateTrigger="disabled"/>
Configure dynamic addition and removal of applications.
As described in Deploy applications to the Liberty profile, applications can be dynamically added to and removed from the server runtime environment through two mechanisms:
- By adding or removing application entries in server.xml.
If you disable dynamic changes to the server configuration as described in the previous step, then adding or removing application entries has no effect on a running server. Your changes are only applied at the next server restart. The changes are picked up immediately, if you update application entries using the developer tools.
- By moving application files into and out of the "dropins" directory.
This behavior can be controlled by setting the applicationMonitor element in server.xml. For example, to disable dynamic installation of applications from the "dropins" location, create an entry as follows:
<applicationMonitor dropinsEnabled="false"/>
Configure dynamic updates to installed applications.
By default, if we add, remove or modify any files within a deployed application, or you replace the whole application with an updated version, the previous version is automatically stopped and the new version is started. This process applies for any deployed application, whether the application is in the "dropins" directory or at a location defined in server.xml. We can control this behavior by setting the applicationMonitor element in server.xml. For example, to disable dynamic update of all applications, create an entry as follows:
<applicationMonitor updateTrigger="disabled"/>
Configure the name and location of the "dropins" directory.
By default, the "dropins" directory is ${server.config.dir}/dropins. We can change this by setting the applicationMonitor element in server.xml. For the location, we can use any known variable, or a property in bootstrap.properties, or an absolute path, or a path relative to the server directory. For example, both the following settings point to the same location:
<applicationMonitor dropins="${server.config.dir}/applications" /> <applicationMonitor dropins="applications" />For web service applications, if the service client and service provider are not in the same application and the WSDL file in the service provider application is changed, we need to restart the web service client application manually to avoid the WSDL definition cache issue.
Parent topic: Administer the Liberty profile manuallyTasks:
Add and run an application on the Liberty profile using developer tools
Deploy applications to the Liberty profile
Directory locations
Configuration elements in server.xml