Cloud Native 6 min read

Mastering Sermant: From Architecture to Hands‑On Plugin Development

This article walks developers through Sermant’s architecture, explaining its plugin mechanism, class isolation, and how to build practical plugins with basic capabilities, unified dynamic configuration, and unified logging, while showcasing real‑world examples and tips for efficient development.

Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Mastering Sermant: From Architecture to Hands‑On Plugin Development

Sermant Core Mechanism – Plugin Architecture

Sermant consists of two layers: the Sermant framework layer and the Sermant service governance layer. The framework provides APIs that enable developers to quickly create service‑governance plugins. The governance layer aggregates various capabilities such as traffic control, tag routing, and includes a Backend for state display and event monitoring.

Sermant Core Mechanism – Class Isolation

Sermant fully isolates classes among the framework, plugins, and microservices, preventing class‑conflict issues. Developers can focus on service‑governance features without worrying about class collisions. Additionally, a local class‑loading mechanism allows plugins to load host classes without resorting to heavy reflection, improving performance.

Sermant Plugin Development Tips

Basic capabilities – Plugins are collections of aspects; the join point defines where an aspect applies, and advice defines the behavior. In Sermant, plugin declarations specify join points, and interceptors implement the advice, supporting before, after, and throw lifecycles, as well as method skipping, parameter modification, return value alteration, and exception handling.

Advanced – Unified Dynamic Configuration – Sermant uses a layered model with Groups and Keys to isolate configuration items, enabling flexible, precise control across different configuration centers without requiring code changes. Plugin developers only need to work with Groups and Keys.

Advanced – Unified Logging – By using the Java Util Logging (JUL) interface, developers can log through a unified API without additional third‑party dependencies. The unified logging is isolated from microservices, and high‑level logs can be monitored and reported automatically.

Follow me, hands‑on plugin development – In the practical session, developers build a simple monitoring plugin that targets specific classes and methods, using plugin declarations and interceptors. The plugin’s activation is controlled via dynamic configuration, and its logs are captured by Sermant’s unified logging, demonstrating a low‑learning‑curve, non‑intrusive monitoring solution.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Javacloud nativeDynamic Configurationservice governancePlugin DevelopmentSermant
Huawei Cloud Developer Alliance
Written by

Huawei Cloud Developer Alliance

The Huawei Cloud Developer Alliance creates a tech sharing platform for developers and partners, gathering Huawei Cloud product knowledge, event updates, expert talks, and more. Together we continuously innovate to build the cloud foundation of an intelligent world.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.