Microsphere Projects for Alibaba Druid
Microsphere Alibaba Druid is a specialized integration project that enhances Alibaba Druid, a high-performance JDBC connection pool, with powerful SQL statement interception capabilities. It enables developers to monitor, log, and control SQL execution at a granular level across different Spring ecosystems, which supports the extension features that would be used for Microsphere Sentinel, Microsphere Resilience4j, Microsphere Observability and so on.
The project extends Druid's capabilities with Spring Framework integration, auto-configuration, and enhanced monitoring features that integrate with the broader Microsphere ecosystem:
- Interception on executing the SQL Statements
- Logging the SQL Statements
| Module | Purpose |
|---|---|
| microsphere-alibaba-druid-core | Foundation classes and filters for Druid integration |
| microsphere-alibaba-druid-spring | Spring Framework integration and configuration |
| microsphere-alibaba-druid-spring-boot | Spring Boot auto-configuration and properties |
| microsphere-alibaba-druid-spring-cloud | Spring Cloud features and service discovery integration |
| microsphere-alibaba-druid-test | Base testing utilities and infrastructure |
| microsphere-alibaba-druid-spring-test | Spring-specific testing utilities |
| microsphere-alibaba-druid-dependencies | Bill of Materials (BOM) for dependency management |
The easiest way to get started is by adding the Microsphere Alibaba Druid BOM (Bill of Materials) to your project's pom.xml:
<dependencyManagement>
<dependencies>
...
<!-- Microsphere Alibaba Druid Dependencies -->
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-alibaba-druid-dependencies</artifactId>
<version>${microsphere-alibaba-druid.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
...
</dependencies>
</dependencyManagement>${microsphere-alibaba-druid.version} has two branches:
| Branches | Purpose | Latest Version |
|---|---|---|
| 0.2.x | Compatible with Spring Cloud 2022.0.x - 2025.0.x | 0.2.0 |
| 0.1.x | Compatible with Spring Cloud Hoxton - 2021.0.x | 0.1.0 |
Then add the specific modules you need.
<dependencies>
<!-- Microsphere Alibaba Druid Spring Cloud -->
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-alibaba-druid-spring-cloud</artifactId>
</dependency>
</dependencies>implementation(platform("io.github.microsphere-projects:microsphere-alibaba-druid-dependencies:0.0.1"))You don't need to build from source unless you want to try out the latest code or contribute to the project.
To build the project, follow these steps:
- Clone the repository:
git clone https://github.com/microsphere-projects/microsphere-alibaba-druid.git- Build the source:
- Linux/MacOS:
./gradlew build- Windows:
gradlew.bat buildWe welcome your contributions! Please read Code of Conduct before submitting a pull request.
- Before you log a bug, please search the issues to see if someone has already reported the problem.
- If the issue doesn't already exist, create a new issue.
- Please provide as much information as possible with the issue report.
- microsphere-alibaba-druid-core
- microsphere-alibaba-druid-spring
- microsphere-alibaba-druid-spring-boot
- microsphere-alibaba-druid-spring-cloud
- microsphere-alibaba-druid-test
- microsphere-alibaba-druid-spring-test
Microsphere Alibaba Druid is licensed under the Apache License, Version 2.0.