Deep Dive into Sermant: Architecture Design and Plugin Development Practices
The article explains Sermant's classloader architecture, plugin mechanism, class isolation, unified dynamic configuration, and logging capabilities, providing step‑by‑step guidance for building service‑governance plugins from basic to advanced features.
The live broadcast titled "From Architecture Design to Development Practice, an Easy Understanding of Sermant" presented by Luan Wenfei, a Huawei Cloud native DTSE evangelist and senior engineer, introduced Sermant's classloader architecture and plugin mechanism, and demonstrated step‑by‑step plugin development from basic capabilities to advanced dynamic configuration and unified logging.
Sermant consists of two layers: the framework layer, which offers APIs for rapid development of service‑governance plugins, and the service‑governance layer, which aggregates capabilities such as traffic control, tag routing, and a Backend for status display and event monitoring.
The framework achieves full class isolation among the framework, plugins, and microservices to prevent class‑conflict issues, and provides a local classloader that allows plugins to load host‑service classes without heavy reflection, thereby improving performance.
In practical terms, a service‑governance plugin is a collection of aspects; the concepts of join point and advice correspond to plugin declarations and interceptors. Declarations can be based on class name, superclass, annotation, etc., while interceptors offer before, after, and throw lifecycles with abilities to skip execution, modify parameters, return values, or exceptions.
For advanced capabilities, Sermant implements a unified dynamic‑configuration model using Group and Key to isolate and manage configuration items, enabling developers to write plugins without depending on any specific configuration‑center implementation.
Unified logging is achieved by using the Java Util Logging (JUL) interface, allowing plugins to emit logs that are isolated from microservice logs; Sermant also adds monitoring for high‑level logs with optional alerting.
The hands‑on session walks through building a simple monitoring plugin, showing how to declare plugin points, intercept methods, control the feature via dynamic configuration, and capture logs, illustrating a low learning curve for Sermant plugin development.
Cognitive Technology Team
Cognitive Technology Team regularly delivers the latest IT news, original content, programming tutorials and experience sharing, with daily perks awaiting you.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.