dawdler-client-plug-load
Module Introduction
Remote loading module. It was previously part of the dawdler-client-plug module, which was split into the dawdler-client-plug-web and dawdler-client-plug-load modules.
The most common use case for this module is building a dynamic gateway.
It supports remote loading of the following three types of components:
1. Adding the Dependency to pom
<groupId>club.dawdler</groupId>
<artifactId>dawdler-client-plug-load</artifactId>
2. Configuring the Components to Load
Refer to the following example. loads-on is the list of configured load items, where channel-group-id corresponds to the server-channel-group declared in the server-channel-group above. For other configurations in the example, see client-conf.xml configuration file description.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<server-channel-group channel-group-id="user-load-web"
connection-num="1"
session-num="4" serializer="2"
user="global_user" password="global_password">
</server-channel-group>
<!-- Dynamically load configuration when the web application starts; dawdler-client-plug-load requires this configuration -->
<loads-on>
<item sleep="15000" channel-group-id="user-load-web" mode="run">user</item><!-- Load the user module from the user-load-web service; channel-group-id specifies the group; mode=run is run mode and no longer checks for updates; if mode is omitted, it defaults to debug mode, which triggers sleep to check the update interval in milliseconds -->
</loads-on>
</config>
Known limitation (mapping vacuum window during hot updates): when debug mode detects an update of a remote module, retiring the old classloader immediately removes all of its path mappings, while the mappings of the new version are registered only after the module has been downloaded and loaded. Requests arriving in the window between the two fail because no target mapping can be found. Mappings are isolated per classloader, so other modules that are not updated are unaffected. For scenarios that require availability during the switch window, use mode=run to deploy a fixed version.