### Example Properties for Single Dubbo Config Bean Bindings Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-autoconfigure/README.md An example set of properties demonstrating the mapping for ApplicationConfig and ModuleConfig beans. ```properties # Single Dubbo Config Bindings ## ApplicationConfig dubbo.application.id = applicationBean dubbo.application.name = dubbo-demo-application ## ModuleConfig dubbo.module.id = moduleBean dubbo.module.name = dubbo-demo-module ``` -------------------------------- ### Dubbo Startup Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Checks if the current framework has been started successfully. ```APIDOC ## GET /actuator/dubbo/startup ### Description Check if the current framework has been started. ### Method GET ### Endpoint /actuator/dubbo/startup ### Response #### Success Response (200) - **Content Type**: application/json ``` -------------------------------- ### Run Maven Plugin and Provider Source: https://github.com/apache/dubbo/blob/3.3/dubbo-demo/dubbo-demo-spring-boot-idl/dubbo-demo-spring-boot-idl-provider/README.md First, compile the Protocol Buffers definitions using the `dubbo:compile` Maven plugin. Then, run the `ProviderApplication` to start the Dubbo service provider. ```shell mvn dubbo:compile java -jar provider.jar ``` -------------------------------- ### Single Dubbo Configuration Properties Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-autoconfigure/README.md Example properties for configuring individual Dubbo components like RegistryConfig, ProtocolConfig, MonitorConfig, ProviderConfig, and ConsumerConfig. ```properties dubbo.registry.address = zookeeper://192.168.99.100:32770 ``` ```properties dubbo.protocol.name = dubbo dubbo.protocol.port = 20880 ``` ```properties dubbo.monitor.address = zookeeper://127.0.0.1:32770 ``` ```properties dubbo.provider.host = 127.0.0.1 ``` ```properties dubbo.consumer.client = netty ``` -------------------------------- ### Dubbo Get Config Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md View the valid configuration of the current application. ```APIDOC ## GET /actuator/dubbo/getconfig ### Description View the valid `configuration` of the current application. ### Method GET ### Endpoint /actuator/dubbo/getconfig ### Response #### Success Response (200) - **Content Type**: application/json ``` -------------------------------- ### Get Enabled Router Snapshot Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Retrieves a list of services that are currently configured for routing result collection. ```APIDOC ## Get Enabled Router Snapshot ### Description Get the services that are currently collecting. ### Method GET ### Endpoint /actuator/dubbo/getEnabledRouterSnapshot ``` -------------------------------- ### Get Serialized Warned Classes Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Displays the list of classes that have triggered serialization warnings in real-time. ```APIDOC ## Get Serialized Warned Classes ### Description View the real-time alarm list. ### Method GET ### Endpoint /actuator/dubbo/dubboserializewarnedclasses ``` -------------------------------- ### Get Recent Router Snapshot Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Retrieves the historical routing status, storing up to 32 results. ```APIDOC ## Get Recent Router Snapshot ### Description Obtain the historical routing status (up to 32 results stored). ### Method GET ### Endpoint /actuator/dubbo/getRecentRouterSnapshot ``` -------------------------------- ### Define Proto File for Greeter Service Source: https://github.com/apache/dubbo/blob/3.3/dubbo-plugin/dubbo-compiler/README.md Defines a simple gRPC service 'DemoService' with a 'SayHello' method and associated request/response messages using Protocol Buffers syntax. ```protobuf syntax = "proto3"; option java_multiple_files = true; option java_package = "org.apache.dubbo.demo"; option java_outer_classname = "DemoServiceProto"; option objc_class_prefix = "DEMOSRV"; package demoservice; // The demo service definition. service DemoService { rpc SayHello (HelloRequest) returns (HelloReply) {} } // The request message containing the user's name. message HelloRequest { string name = 1; } // The response message containing the greetings message HelloReply { string message = 1; } ``` -------------------------------- ### Make a Sample HTTP Request Source: https://github.com/apache/dubbo/blob/3.3/dubbo-demo/dubbo-demo-spring-boot-idl/dubbo-demo-spring-boot-idl-provider/README.md Use `curl` to send a JSON payload to the `sayHello` endpoint for a synchronous RPC call. Ensure the `Content-Type` header is set to `application/json`. ```shell curl -v -d '{"name":"dubbo"}' -H 'Content-Type: application/json' http://127.0.0.1:50051/org.apache.dubbo.demo.hello.GreeterService/sayHello ``` -------------------------------- ### Get Serialization Check Status Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Retrieves the current configuration status for Dubbo serialization checks. ```APIDOC ## Get Serialization Check Status ### Description View the current configuration information. ### Method GET ### Endpoint /actuator/dubbo/dubboserializecheckstatus ``` -------------------------------- ### Dubbo Compiler Usage Source: https://github.com/apache/dubbo/blob/3.3/dubbo-plugin/dubbo-compiler/README.md This section details the steps to define a proto file, configure the dubbo-maven-plugin, and generate code. ```APIDOC ## Define Proto file This is an example of a `.proto` file defining a service and messages. ```protobuf syntax "proto3"; option java_multiple_files = true; option java_package = "org.apache.dubbo.demo"; option java_outer_classname = "DemoServiceProto"; option objc_class_prefix = "DEMOSRV"; package demoservice; // The demo service definition. service DemoService { rpc SayHello (HelloRequest) returns (HelloReply) {} } // The request message containing the user's name. message HelloRequest { string name = 1; } // The response message containing the greetings message HelloReply { string message = 1; } ``` ## Use dubbo-maven-plugin Configure your `pom.xml` to use `dubbo-maven-plugin` for code generation instead of `protobuf-maven-plugin`. ```xml org.apache.dubbo dubbo-maven-plugin ${dubbo.version} compile ``` ## Generated Code Example This is an example of the Java interface generated by the Dubbo compiler for the `DemoService`. ```java /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dubbo.demo; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicBoolean; public final class DemoServiceDubbo { private static final AtomicBoolean registered = new AtomicBoolean(); private static Class init() { Class clazz = null; try { clazz = Class.forName(DemoServiceDubbo.class.getName()); if (registered.compareAndSet(false, true)) { org.apache.dubbo.common.serialize.protobuf.support.ProtobufUtils.marshaller( org.apache.dubbo.demo.HelloReply.getDefaultInstance()); org.apache.dubbo.common.serialize.protobuf.support.ProtobufUtils.marshaller( org.apache.dubbo.demo.HelloRequest.getDefaultInstance()); } } catch (ClassNotFoundException e) { // ignore } return clazz; } private DemoServiceDubbo() {} public static final String SERVICE_NAME = "org.apache.dubbo.demo.DemoService"; /** * Code generated for Dubbo */ public interface IDemoService extends org.apache.dubbo.rpc.model.DubboStub { static Class clazz = init(); org.apache.dubbo.demo.HelloReply sayHello(org.apache.dubbo.demo.HelloRequest request); CompletableFuture sayHelloAsync(org.apache.dubbo.demo.HelloRequest request); } } ``` -------------------------------- ### Enable Detail Profiler Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Enable the detail profiler mode using `/actuator/dubbo/enableDetailProfiler`. This mode provides more granular performance data than the simple profiler and requires the simple profiler to be enabled first. It is useful for in-depth troubleshooting. ```http /actuator/dubbo/enableDetailProfiler ``` -------------------------------- ### Dubbo Get Address Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md View the list of valid IP addresses for a specified service. ```APIDOC ## GET /actuator/dubbo/getaddress?args=xxx.* ### Description View the list of valid `IP` addresses for a service. ### Method GET ### Endpoint /actuator/dubbo/getaddress ### Query Parameters - **args** (string) - Required - Service name pattern (e.g., `xxx.*`). ### Response #### Success Response (200) - **Content Type**: application/json ``` -------------------------------- ### Initialize Swagger UI Source: https://github.com/apache/dubbo/blob/3.3/dubbo-plugin/dubbo-rest-openapi/src/main/resources/META-INF/resources/swagger-ui/index.html Initializes Swagger UI with specified configurations including URL, DOM element, deep linking, presets, plugins, layout, and custom settings. Use this to embed interactive API documentation. ```javascript window.onload = function () { window.ui = SwaggerUIBundle({ url: "", dom_id: '#swagger-ui', deepLinking: true, presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ], plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], layout: "StandaloneLayout", "configUrl": "./swagger-config", "displayRequestDuration": true, "operationsSorter": "method" {{swagger-ui.settings}} }); }; ``` -------------------------------- ### Get ApplicationConfig Bean from Spring BeanFactory Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-autoconfigure/README.md Retrieve the current ApplicationConfig Bean from the Spring BeanFactory when needed. ```java BeanFactory beanFactory = .... ApplicationConfig applicationConfig = beanFactory.getBean(ApplicationConfig.class) ``` -------------------------------- ### Enable Simple Profiler Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Enables the simple profiler mode. This is enabled by default. ```APIDOC ## Enable Simple Profiler ### Description Enable `simple profiler` mode, enabled by default. ### Method GET ### Endpoint /actuator/dubbo/enableSimpleProfiler ``` -------------------------------- ### Add Apache Snapshot Repository Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-autoconfigure/README.md If your project fails to resolve the dependency, add this Apache snapshot repository to your pom.xml. ```xml apache.snapshots.https Apache Development Snapshot Repository https://repository.apache.org/content/repositories/snapshots false true ``` -------------------------------- ### Dubbo Health Check Response Example Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md This JSON structure represents the health status of a Dubbo application, including details on memory, load, thread pool, and server status. ```json { "status": "UP", "dubbo": { "status": "UP", "memory": { "source": "management.health.dubbo.status.defaults", "status": { "level": "OK", "message": "max:3641M,total:383M,used:92M,free:291M", "description": null } }, "load": { "source": "management.health.dubbo.status.extras", "status": { "level": "OK", "message": "load:1.73583984375,cpu:8", "description": null } }, "threadpool": { "source": "management.health.dubbo.status.extras", "status": { "level": "OK", "message": "Pool status:OK, max:200, core:200, largest:0, active:0, task:0, service port: 12345", "description": null } }, "server": { "source": "dubbo@ProtocolConfig.getStatus()", "status": { "level": "OK", "message": "/192.168.1.103:12345(clients:0)", "description": null } } } // ignore others } ``` -------------------------------- ### Switch Log Level Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Allows switching between permitted log levels. The `args` parameter is required and specifies the desired log level. ```APIDOC ## POST /actuator/dubbo/switchLogLevel ### Description Allows switching between permitted log levels. The `args` parameter is required and specifies the desired log level. ### Method POST ### Endpoint /actuator/dubbo/switchLogLevel ### Parameters #### Query Parameters - **args** (string) - Required - The desired log level (e.g., WARN). ### Request Example ``` /actuator/dubbo/switchLogLevel?args=WARN ``` **Note:** The log configuration modified by this endpoint is not persistent and will be reset after the application restarts. ``` -------------------------------- ### Enable Detail Profiler Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Enables the detail profiler mode. Note that the simple profiler mode must be enabled first. ```APIDOC ## Enable Detail Profiler ### Description Enable the `detail profiler` mode, which is disabled by default, you need to enable the `simple profiler` mode to actually enable it. ### Method GET ### Endpoint /actuator/dubbo/enableDetailProfiler ``` -------------------------------- ### Configure dubbo-maven-plugin for Proto Compilation Source: https://github.com/apache/dubbo/blob/3.3/dubbo-plugin/dubbo-compiler/README.md Integrates the dubbo-maven-plugin into the Maven build to enable code generation from proto files during the compile phase. ```xml org.apache.dubbo dubbo-maven-plugin ${dubbo.version} compile ``` -------------------------------- ### Switch Log Level Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Use the `/actuator/dubbo/switchLogLevel` endpoint to change the application's log level. The `args` parameter specifies the desired level (e.g., WARN). Note that these changes are not persistent and are lost upon application restart. ```http /actuator/dubbo/switchLogLevel?args=WARN ``` -------------------------------- ### Dubbo Help Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Lists all available commands for the Dubbo Actuator endpoint. ```APIDOC ## GET /actuator/dubbo/help ### Description List all commands. ### Method GET ### Endpoint /actuator/dubbo/help ### Response #### Success Response (200) - **Content Type**: (Not specified) ``` -------------------------------- ### Enable Router Snapshot Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Enables the collection mode for routing results. Can optionally specify a pattern to enable for specific routes. ```APIDOC ## Enable Router Snapshot ### Description Enable routing result collection mode. ### Method GET ### Endpoint /actuator/dubbo/enableRouterSnapshot or /actuator/dubbo/enableRouterSnapshot?args=xxx.* ### Parameters #### Query Parameters - **args** (string) - Optional - A pattern to specify which routes to enable snapshotting for (e.g., `xxx.*`). ``` -------------------------------- ### Configure Single Dubbo Config Bean Bindings Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-autoconfigure/README.md Configure Dubbo's *Config Beans by adding properties to application.properties. The prefix 'dubbo.' is used for property names. ```properties dubbo.application.name = foo dubbo.application.owner = bar dubbo.registry.address = 10.20.153.10:9090 ``` -------------------------------- ### Dubbo References Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Exposes all Dubbo `ReferenceBean` instances, detailing the services the application consumes. ```APIDOC ## GET /actuator/dubbo/references ### Description Exposes all Dubbo's `ReferenceBean`. ### Method GET ### Endpoint /actuator/dubbo/references ### Response #### Success Response (200) - **Content Type**: application/json ``` -------------------------------- ### Multiple Dubbo Config Bean Bindings Properties Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-autoconfigure/README.md Demonstrates how to configure multiple instances of Dubbo config beans by prefixing properties with the bean ID. This allows for distinct configurations for different services or components. ```properties dubbo.applications.application1.name = dubbo-demo-application dubbo.applications.application2.name = dubbo-demo-application2 ``` ```properties dubbo.modules.module1.name = dubbo-demo-module ``` ```properties dubbo.registries.registry1.address = zookeeper://192.168.99.100:32770 ``` ```properties dubbo.protocols.protocol1.name = dubbo dubbo.protocols.protocol1.port = 20880 ``` ```properties dubbo.monitors.monitor1.address = zookeeper://127.0.0.1:32770 ``` ```properties dubbo.providers.provider1.host = 127.0.0.1 ``` ```properties dubbo.consumers.consumer1.client = netty ``` -------------------------------- ### List Consumers and Providers Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md This output from the `/actuator/dubbo/ls` endpoint lists Dubbo services from both provider and consumer perspectives. It details service names and their registration/subscription status with registries. ```text As Provider side: +-----------------------------------------------------------------------------------+ | Provider Service Name | +-----------------------------------------------------------------------------------+ | DubboInternal - dubbo-springboot-demo-provider/org.apache.dubbo.metadata.MetadataService: 1.0.0 | +-----------------------------------------------------------------------------------+ |DubboInternal - dubbo-springboot-demo-provider/org.apache.dubbo.metrics.service.MetricsService: 1.0.0| +-----------------------------------------------------------------------------------+ | org.apache.dubbo.springboot.demo.DemoService | +-----------------------------------------------------------------------------------+ As Consumer side: +---------------------+---+ |Consumer Service Name|NUM| +---------------------+---+ ``` -------------------------------- ### Dubbo Live Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Checks whether the current process or service is alive and running. ```APIDOC ## GET /actuator/dubbo/live ### Description Check whether the current process/service is alive. ### Method GET ### Endpoint /actuator/dubbo/live ### Response #### Success Response (200) - **Content Type**: application/json ``` -------------------------------- ### Dubbo Ready Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Checks whether the current process or service is ready to accept external traffic. ```APIDOC ## GET /actuator/dubbo/ready ### Description Check whether the current process/service is ready for external service. ### Method GET ### Endpoint /actuator/dubbo/ready ### Response #### Success Response (200) - **Content Type**: application/json ``` -------------------------------- ### Configure StatusChecker Defaults Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Set default StatusChecker names using the `management.health.dubbo.status.defaults` property. Multiple checkers can be specified, separated by commas. ```properties management.health.dubbo.status.defaults = registry,memory,load ``` -------------------------------- ### Enable Detail Profiler Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Enables the 'detail profiler' mode, which is disabled by default. This mode requires the 'simple profiler' mode to be enabled to function and provides more detailed performance insights. ```APIDOC ## POST /actuator/dubbo/enableDetailProfiler ### Description Enables the 'detail profiler' mode, which is disabled by default. This mode requires the 'simple profiler' mode to be enabled to function and provides more detailed performance insights compared to the 'simple profiler'. It collects more time-consuming processing of each filter and specific time-consuming protocols. ### Method POST ### Endpoint /actuator/dubbo/enableDetailProfiler **Note:** To effectively troubleshoot long-running situations within the Dubbo framework, enabling the 'detail profiler' mode is recommended after enabling the 'simple profiler' mode. ``` -------------------------------- ### Dubbo Configs Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Exposes all Dubbo `*Config` beans, providing insight into the application's Dubbo configuration. ```APIDOC ## GET /actuator/dubbo/configs ### Description Exposes all Dubbo's `*Config`. ### Method GET ### Endpoint /actuator/dubbo/configs ### Response #### Success Response (200) - **Content Type**: application/json ``` -------------------------------- ### Generated Dubbo Service Interface Source: https://github.com/apache/dubbo/blob/3.3/dubbo-plugin/dubbo-compiler/README.md This Java code is generated by dubbo-compiler. It provides a Dubbo service interface 'IDemoService' for the 'DemoService' defined in the proto file, including synchronous and asynchronous method signatures. ```java /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dubbo.demo; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicBoolean; public final class DemoServiceDubbo { private static final AtomicBoolean registered = new AtomicBoolean(); private static Class init() { Class clazz = null; try { clazz = Class.forName(DemoServiceDubbo.class.getName()); if (registered.compareAndSet(false, true)) { org.apache.dubbo.common.serialize.protobuf.support.ProtobufUtils.marshaller( org.apache.dubbo.demo.HelloReply.getDefaultInstance()); org.apache.dubbo.common.serialize.protobuf.support.ProtobufUtils.marshaller( org.apache.dubbo.demo.HelloRequest.getDefaultInstance()); } } catch (ClassNotFoundException e) { // ignore } return clazz; } private DemoServiceDubbo() {} public static final String SERVICE_NAME = "org.apache.dubbo.demo.DemoService"; /** * Code generated for Dubbo */ public interface IDemoService extends org.apache.dubbo.rpc.model.DubboStub { static Class clazz = init(); org.apache.dubbo.demo.HelloReply sayHello(org.apache.dubbo.demo.HelloRequest request); CompletableFuture sayHelloAsync(org.apache.dubbo.demo.HelloRequest request); } } ``` -------------------------------- ### Dubbo Services Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Exposes all Dubbo `ServiceBean` instances, detailing the services exposed by the application. ```APIDOC ## GET /actuator/dubbo/services ### Description Exposes all Dubbo's `ServiceBean`. ### Method GET ### Endpoint /actuator/dubbo/services ### Response #### Success Response (200) - **Content Type**: application/json ``` -------------------------------- ### Dubbo Process Information Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md View information about the current process, including listenable ports. ```APIDOC ## GET /actuator/dubbo/ps ### Description View information about the current process, including `listenable` ports. ### Method GET ### Endpoint /actuator/dubbo/ps ### Response #### Success Response (200) - **Content Type**: application/json ``` -------------------------------- ### Dubbo Switch Logger Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Modifies the log output framework. Supported adapters include: `slf4j`, `jcl`, `log4j`, `jdk`, `log4j2`. ```APIDOC ## GET /actuator/dubbo/switchLogger?args={loggerAdapterName} ### Description Modify the log output framework. `loggerAdapterName`: `slf4j`, `jcl`, `log4j`, `jdk`, `log4j2`. ### Method GET ### Endpoint /actuator/dubbo/switchLogger ### Query Parameters - **args** (string) - Required - The name of the logger adapter to switch to. ### Response #### Success Response (200) - **Content Type**: application/json ``` -------------------------------- ### Make an Asynchronous HTTP Request Source: https://github.com/apache/dubbo/blob/3.3/dubbo-demo/dubbo-demo-spring-boot-idl/dubbo-demo-spring-boot-idl-provider/README.md Send a JSON payload to the `sayHelloAsync` endpoint using `curl` for an asynchronous RPC call. The `Content-Type` should be `application/json`. ```shell curl -v -d '{"name":"dubbo async"}' -H 'Content-Type: application/json' http://127.0.0.1:50051/org.apache.dubbo.demo.hello.GreeterService/sayHelloAsync ``` -------------------------------- ### Dubbo Metadata Endpoint Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md The `/actuator/dubbo` endpoint exposes Dubbo's general metadata. This includes version information for both Dubbo and the Spring Boot integration, as well as links to relevant resources like the project's GitHub repository and mailing lists. ```json { "timestamp": 1516623290166, "versions": { "dubbo-spring-boot": "2.7.5", "dubbo": "2.7.5" }, "urls": { "dubbo": "https://github.com/apache/dubbo/", "google-group": "dev@dubbo.apache.org", "github": "https://github.com/apache/dubbo-spring-boot-project", "issues": "https://github.com/apache/dubbo-spring-boot-project/issues", "git": "https://github.com/apache/dubbo-spring-boot-project.git" } } ``` -------------------------------- ### Integrate Dubbo Spring Boot Actuator with Maven Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Add the dubbo-spring-boot-actuator dependency to your project's pom.xml to include production-ready features. ```xml org.apache.dubbo dubbo-spring-boot-actuator 2.7.4.1 ``` -------------------------------- ### Integrate Dubbo Tag Header or URL Parameter Interceptor with Spring Boot Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot/README.md Configure a WebMvcConfigurer to add a DubboTagHeaderOrParameterInterceptor. This interceptor copies header tags (dubbo-tag) or falls back to URL parameter tags (dubbo.tag) if no header is present. ```java @Configuration public class WebMvcConfig implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new DubboTagHeaderOrParameterInterceptor()).addPathPatterns("/*").excludePathPatterns("/admin"); } } ``` -------------------------------- ### Make a Server Stream HTTP Request Source: https://github.com/apache/dubbo/blob/3.3/dubbo-demo/dubbo-demo-spring-boot-idl/dubbo-demo-spring-boot-idl-provider/README.md Utilize `curl` to send a JSON payload to the `sayHelloStream` endpoint for a server streaming RPC. Set the `Content-Type` header to `application/json`. ```shell curl -v -d '{"name":"dubbo"}' -H 'Content-Type: application/json' http://127.0.0.1:50051/org.apache.dubbo.demo.hello.GreeterService/sayHelloStream ``` -------------------------------- ### Enable All Dubbo Actuator Endpoints Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Configure externalized properties to enable all Dubbo-related actuator endpoints. This includes endpoints for services, configurations, shutdown, and more. ```properties # Enables Dubbo All Endpoints management.endpoint.dubbo.enabled = true management.endpoint.dubboshutdown.enabled = true management.endpoint.dubboconfigs.enabled = true management.endpoint.dubboservices.enabled = true management.endpoint.dubboreferences.enabled = true management.endpoint.dubboproperties.enabled = true management.endpoint.dubbo.help.enabled = true management.endpoint.dubbo.ready.enabled = true management.endpoint.dubbo.ls.enabled = true management.endpoint.dubbo.live.enabled = true management.endpoint.dubbo.startup.enabled = true management.endpoint.dubbo.ps.enabled = true management.endpoint.dubbo.version.enabled = true management.endpoint.dubbo.getaddress.enabled = true management.endpoint.dubbo.getconfig.enabled = true management.endpoint.dubbo.metrics.enabled = true management.endpoint.dubbo.metrics_default.enabled = true management.endpoint.dubbo.publishmetadata.enabled = true management.endpoint.dubbo.online.enabled = true management.endpoint.dubbo.onlineapp.enabled = true management.endpoint.dubbo.onlineinterface.enabled = true management.endpoint.dubbo.offline.enabled = true management.endpoint.dubbo.offlineapp.enabled = true management.endpoint.dubbo.offlineinterface.enabled = true management.endpoint.dubbo.loggerinfo.enabled = true management.endpoint.dubbo.switchlogger.enabled = true management.endpoint.dubbo.switchloglevel.enabled = true management.endpoint.dubbo.disabledetailprofiler.enabled = true management.endpoint.dubbo.disablesimpleprofiler.enabled = true management.endpoint.dubbo.enabledetailprofiler.enabled = true management.endpoint.dubbo.enablesimpleprofiler.enabled = true management.endpoint.dubbo.setprofilerwarnpercent.enabled = true management.endpoint.dubbo.serializecheckstatus.enabled = true management.endpoint.dubbo.serializewarnedclasses.enabled = true management.endpoint.dubbo.disableroutersnapshot.enabled = true management.endpoint.dubbo.enableroutersnapshot.enabled = true management.endpoint.dubbo.getrecentroutersnapshot.enabled = true management.endpoint.dubbo.getenabledroutersnapshot.enabled = true management.endpoint.dubbo.gracefulshutdown.enabled = true ``` -------------------------------- ### Graceful Shutdown Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md The `/actuator/dubbo/gracefulShutdown` endpoint unregisters services from the registry and notifies consumers to stop calling the instance. This is a more controlled shutdown than 'offline', allowing for a graceful transition. ```http /actuator/dubbo/gracefulShutdown ``` -------------------------------- ### List Consumers and Providers Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md This endpoint lists consumers and providers, displaying service information for both provider and consumer sides. ```APIDOC ## GET /actuator/dubbo/ls ### Description Lists consumers and providers, displaying service information for both provider and consumer sides. ### Method GET ### Endpoint /actuator/dubbo/ls ### Response #### Success Response (200) - **Provider side information**: Details about published services. - **Consumer side information**: Details about subscribed services. ### Response Example ``` As Provider side: +-----------------------------------------------------------------------------------+ | Provider Service Name | +-----------------------------------------------------------------------------------+ | DubboInternal - dubbo-springboot-demo-provider/org.apache.dubbo.metadata.MetadataService: 1.0.0 | +-----------------------------------------------------------------------------------+ |DubboInternal - dubbo-springboot-demo-provider/org.apache.dubbo.metrics.service.MetricsService: 1.0.0| +-----------------------------------------------------------------------------------+ | org.apache.dubbo.springboot.demo.DemoService | +-----------------------------------------------------------------------------------+ As Consumer side: +---------------------+---+ |Consumer Service Name|NUM| +---------------------+---+ ``` **Notes:** - Services prefixed with `DubboInternal` are built-in services of Dubbo and are not registered with the registry by default. - The format `zookeeper-A(Y)` indicates registry name, registration mode (`A` for application-level, `I` for interface-level), and registration status. - The format `zookeeper-AF(I-2,A-2)` indicates registry name, subscription mode (`AF`, `FA`, `FI`), address source mode, and address count. ``` -------------------------------- ### Integrate Dubbo Spring Boot Auto-Configure with Maven Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-autoconfigure/README.md Add the dubbo-spring-boot-autoconfigure dependency to your pom.xml to include auto-configuration features. ```xml org.apache.dubbo dubbo-spring-boot-autoconfigure 2.7.4.1 ``` -------------------------------- ### Graceful Shutdown Source: https://github.com/apache/dubbo/blob/3.3/dubbo-spring-boot-project/dubbo-spring-boot-actuator/README.md Unregisters all services registered by the current IP instance from the registry and notifies consumers to stop calling the instance. This is a more comprehensive shutdown than 'offline'. ```APIDOC ## POST /actuator/dubbo/gracefulShutdown ### Description Unregisters all services registered by the current IP instance from the registry. The difference from 'offline' is that this command will also notify all consumers via TCP connection to stop calling this instance. To restore, please execute 'online' to bring all services back online. ### Method POST ### Endpoint /actuator/dubbo/gracefulShutdown ```