diff --git a/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/pom.xml b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..b637abe2f880e2d7461b78b00c2f22212d8c6067 --- /dev/null +++ b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + org.dromara.dynamictp + dynamic-tp-example-adapter-apache-dubbo + ${revision} + ../pom.xml + + + dynamic-tp-example-adapter-apache-dubbo-3.2.10 + + + + org.apache.dubbo + dubbo + 3.2.10 + + + org.apache.dubbo + dubbo-spring-boot-starter + 3.2.10 + + + com.alibaba.nacos + nacos-client + 2.1.0 + + + \ No newline at end of file diff --git a/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/DubboExampleApplication.java b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/DubboExampleApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..8d45d56c5c372e619ed703f184f63273197e0d7d --- /dev/null +++ b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/DubboExampleApplication.java @@ -0,0 +1,35 @@ +/* + * 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.dromara.dynamictp.example; + +import org.dromara.dynamictp.core.spring.EnableDynamicTp; +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author fabian4 + */ +@EnableDubbo +@EnableDynamicTp +@SpringBootApplication +public class DubboExampleApplication { + public static void main(String[] args) { + SpringApplication.run(DubboExampleApplication.class, args); + } +} diff --git a/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/controller/TestController.java b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/controller/TestController.java new file mode 100644 index 0000000000000000000000000000000000000000..806bb7481c554138c95f17b41cd9d598a69606e7 --- /dev/null +++ b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/controller/TestController.java @@ -0,0 +1,42 @@ +/* + * 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.dromara.dynamictp.example.controller; + +import org.dromara.dynamictp.example.dubbo.DubboUserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * @author fabian4 + */ +@Slf4j +@RestController +@SuppressWarnings("all") +public class TestController { + + @Resource + private DubboUserService dubboUserService; + + @GetMapping("/dtp-example-adapter/testDubbo") + public String testDubbo() throws InterruptedException { + return dubboUserService.getUserName(1001); + } +} diff --git a/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/dubbo/DubboUserService.java b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/dubbo/DubboUserService.java new file mode 100644 index 0000000000000000000000000000000000000000..86c9a97f48f3dd53a484ffa2bc7a465b08b10b30 --- /dev/null +++ b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/dubbo/DubboUserService.java @@ -0,0 +1,29 @@ +/* + * 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.dromara.dynamictp.example.dubbo; + +/** + * DubboUserService related + * + * @author kyao + * @since 1.1.6 + **/ +public interface DubboUserService { + + String getUserName(long id); +} diff --git a/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/dubbo/DubboUserServiceImpl.java b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/dubbo/DubboUserServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..63b647d96903602a19797a73af0cbae4c651bc5c --- /dev/null +++ b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/java/org/dromara/dynamictp/example/dubbo/DubboUserServiceImpl.java @@ -0,0 +1,35 @@ +/* + * 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.dromara.dynamictp.example.dubbo; + +import org.apache.dubbo.config.annotation.DubboService; + +/** + * DubboUserServiceImpl related + * + * @author kyao + * @since 1.1.6 + **/ +@DubboService +public class DubboUserServiceImpl implements DubboUserService { + + @Override + public String getUserName(long id) { + return "kyao"; + } +} diff --git a/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/resources/application.yml b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/resources/application.yml new file mode 100644 index 0000000000000000000000000000000000000000..7d1cfecb3a74da7cafe09a85407f49f1b7f7602e --- /dev/null +++ b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.2.10/src/main/resources/application.yml @@ -0,0 +1,55 @@ +server: + port: 9102 + +spring: + application: + name: dynamic-tp-adapter-dubbo-demo + + dynamic: + tp: + enabled: true + enabledCollect: true # 是否开启监控指标采集,默认false + collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer + monitorInterval: 5 + platforms: # 通知报警平台配置 + - platform: ding + urlKey: f80dad441fcd655438f4a08dcd6a # 替换 + secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值 + receivers: 15810119805 # 钉钉账号手机号 + - platform: lark + urlKey: 0d944ae7-b24a-40 # 替换 + receivers: test1,test2 # 接受人飞书名称/openid + dubboTp: # dubbo 线程池配置 + - threadPoolName: dubboTp#20880 # 名称规则:dubboTp + "#" + 协议端口 + threadPoolAliasName: 测试线程池 + corePoolSize: 100 + maximumPoolSize: 200 + keepAliveTime: 60 + notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警) + - type: capacity # 报警项类型,查看源码 NotifyTypeEnum枚举类 + enabled: true + threshold: 80 # 报警阈值 + platforms: [ ding ] # 可选配置,不配置默认拿上层platforms配置的所以平台 + interval: 120 # 报警间隔(单位:s) + +dubbo: + application: + name: dynamic-tp-adapter-demo + registry: + address: nacos://127.0.0.1:8848 + protocol: + name: dubbo + port: 20880 + + +# 开启 SpringBoot Actuator Endpoint 暴露出DynamicTp指标接口 +# 开启 prometheus 指标采集端点 +management: + metrics: + export: + prometheus: + enabled: true + endpoints: + web: + exposure: + include: '*' # 测试使用,线上不要用*,按需开启 \ No newline at end of file diff --git a/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/pom.xml b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/pom.xml index 92831795938e7520b428eb8032cf2de5b6c6f95b..04260106d17d325491f9c71956328ccf449bbdea 100644 --- a/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/pom.xml +++ b/example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/pom.xml @@ -16,5 +16,6 @@ example-adapter-apache-dubbo-2.7.3 example-adapter-apache-dubbo-2.7.9 example-adapter-apache-dubbo-3.0.7 + example-adapter-apache-dubbo-3.2.10 \ No newline at end of file