mirror of https://github.com/longtai-cn/hippo4j
Sync main branch (#920)
* Tentative contributor update action * fix : supplement unit test for ThreadPoolManager (#805) * FIX Data truncation: Data too long for column 'tp_id' at row (#738) (#804) * add BeanUtilTest test case * add BeanUtilTest test case * add BeanUtilTest test case * add ClassUtilTest test case * add ConfigExecutorTest test case * Revert "add ConfigExecutorTest test case" This reverts commitmainffc00ff4
* add ConfigExecutorTest test case * add EnvUtilTest test case * add ConfigExecutorTest test case * add Md5ConfigUtilTest test case * Revert "add Md5ConfigUtilTest test case" This reverts commitee949adc
* add Md5ConfigUtilTest test case * Revert "add Md5ConfigUtilTest test case" This reverts commited638916
* add Md5ConfigUtilTest test case * FIX Data truncation: Data too long for column 'tp_id' at row (#738) * FIX Data truncation: Data too long for column 'tp_id' at row (#738) * Mandatory to specify the ip+port registered by the client (#799) * Update using company * Front-end code update * Official document update * Released version 1.4.0 * Development of version 1.4.3 * Update README.md (#806) * Database table structure file adjustment * Optimize the H2 initialization logic (#807) * Added config mode springboot 1.x adaptation document * Fix the CheckStyle code format * JwtTokenManagerTest 补充测试用例 (#813) * Refactored thread pool monitoring (#816) * Refactor the server module (#817) * Refactor the server module (#817) * Hippo4j console ui migrated to this project (#818) * Query the Web thread pool list to add the framework logo (#819) * Fix the exception to timeout type alarm of lark (#820) * Add English README * Change of file format * Added container and tripartite framework thread pool monitoring (#816) * feat:Early method return (#823) * Dynamically registered thread pool queue capacity assignment error (#824) * Adjust thread pool build notification parameter priority (#825) * feat:The core thread must not be larger than the maximum thread. (#838) * organize the toolkit, add references and reference sources (#835) * fix : organize the toolkit, add references and reference sources * fix : add MemoryUtil for get memory info * fix : code format adjustment * Document update * Code optimization * docker-startup.sh的mysql配置多个“-”修复 (#840) * Lease.isExpired()方法判断过期时间去掉duration (#843) Co-authored-by: weizhangqing <weizhangqing@icloudshield.com> * Code optimization * Code optimization (#847) * feat:Long polling returns the appropriate status code (#848) * docker packaging issues fixed * default subscribe to the remote thread pool configuration. (#850) * feat:default subscribe to the remote thread pool configuration. * feat:default empty list * smart h2 storage path. (#857) * Add codecov * Add .codecov.yml * Update codecov * Supplemental code comments * Supplemental code comments (#860) * Add jacoco-maven-plugin * Update ci.yml * Update ci.yml * Update ci.yml * Skip the jacoco plugin by default * Add jacoco-maven-plugin (#861) * Supplemental code comments * Add jacoco-maven-plugin * Update ci.yml * Update ci.yml * Update ci.yml * Skip the jacoco plugin by default * Change shields icon * Change shields icon * Add LocalDataChangeEventTest * Add LocalDataChangeEventTest (#863) * Update README.md * Update README-EN.md * Add lombok (#867) * Add LocalDataChangeEventTest * Add lombok.config * Update lombok.config * After the dynamic thread pool is modified multiple times, the queue prompt information is lost (#868) * Official Documentation Update * Officially added internationalization function (#866) * Auto alerts (#872) * Simplified DynamicThreadPool usage * Simplified DynamicThreadPool usage * init * add Auto Alerts * The official website opens the multi-version function (#864) * refactor the function extension logic of DynamicThreadPoolExecutor (#815) (#854) * feat: Add a new thread-pool that supports the registration of callback interfaces * feat: Add plugins to support the default extensions of DynamicThreadPoolExecutor * refactor: Deprecate AbstractDynamicExecutorSupport and make DynamicThreadPoolExecutor extend ExtensibleThreadPoolExecutor (#815) * fix: obtained plugin list may cause thread-safe problems during iteration * refactor: Make DynamicThreadPoolExecutor support the selection of shutdown mode in destroy Co-authored-by: 马称 Ma Chen <machen@apache.org> * Format code (#873) * Simplified DynamicThreadPool usage * Simplified DynamicThreadPool usage * init * format code * Optimize code exception information * Increase unit test code coverage * feat:Alarm content (#877) * In version 1.4.3, the DingTalk alarm keyword was modified (#869) * Add registered company * test: Add unit test for DynamicThreadPoolExecutor and ExtensibleThreadPoolExecutor (#884) * refactor: Extract the logic about calculating task execution time to superclass (#879) (#882) * test: Add benchmark test for TaskTimeRecord (#885) * Update .codecov.yml * Field style refactoring and adding method logs (#878) * Adjust the conditions for nominating core developers * Client instance registration information code refactoring (#888) (#889) * Add method and field annotations (#890) * Supplementary Methods Notes (#891) * Add method and field annotations * Supplementary Methods Notes * Change the thread pool running data assignment * Change post log location * doc: Update developer (#893) * test: Add unit test about plugin manager (#892) * Update core developer list * revert Hippo4jBaseSendMessageService implement CommandLineRunner interface; (#895) notifyConfigs filed will not be init when use InitializingBean interface * Adapt to delayed loading (#886) * feat:Adapt to delayed loading * feat:Field Rename * Supplemental code comments (#898) * Server-side and client-side model of rpc mode call based on netty (#880) * fix : add toolkit * feat : Implement rpc calls through netty, implement server side and client side respectively, the underlying network connection and pipeline context mechanism depend on netty(#812) * fix : Modifying the comment Format (#812) * fix bug (#899) * test: add test for plugins (#896) * test: add test for plugins * test: Adjust the time precision of test cases * fix #901 (#902) * Supplemental code comments (#904) * Update .codecov.yml * Update .codecov.yml * Spring post processor logic refactoring (#874) (#905) * Format code (#906) * Update .codecov.yml * Format code (#907) * Add DynamicThreadPoolBannerHandlerTest (#908) * Update .codecov.yml * Code optimization and logic refactoring (#909) * Code optimization and logic refactoring * Code optimization and logic refactoring * Remove useless modules and refactor code * Remove kafka modules * Remove kafka code * Update basic project information * Refactor notification alerts and jar dependencies * Refactor notification alerts and jar dependencies (#911) * add new model hippo4j-rpc and Transfer rpc code to hippo4j-rpc (#912) * fix : add new model hippo4j-rpc (#812) * fix : fix : Transfer code to hippo4j-rpc (#812) * fix : Add set multiple ChannelHandler(#812) * fix : Code format modification * Update the front-end thread pool monitoring page * update hippo4j-rpc pom.xml, Change the value of the packaging t… (#913) * fix : update hippo4j-rpc pom.xml, Change the value of the packaging tag from pom to jar * fix : update hippo4j-rpc pom.xml, Change the value of the packaging tag from pom to jar * Support automatic registration of plugins and plugin registrars (#914) * feat: Support to centralized management of all plugins * feat: Support automatic registration of plugins and plugin registrars * Task execution timeout time assignment * Refactor dynamic thread pool registration variable naming * Enable Update Contributor action * Update pom.xml * Update the list of contributors (#917) Co-authored-by: hippo4jbot[bot] <wechat202110@163.com> * Update the list of contributors (#916) Co-authored-by: hippo4jbot[bot] <wechat202110@163.com> * Refactor official documentation * Update team page * Stop running status collection when the project is closed gracefully (#918) * Update official website documents * Released version 1.4.3 Co-authored-by: pizihao <48643103+pizihao@users.noreply.github.com> Co-authored-by: Gdk666 <763366136@qq.com> Co-authored-by: shanjianq <49084314+shanjianq@users.noreply.github.com> Co-authored-by: zoujin001 <45163196+zoujin001@users.noreply.github.com> Co-authored-by: WuLang <48200100+wulangcode@users.noreply.github.com> Co-authored-by: Malcolm <33982485+Malcolmli@users.noreply.github.com> Co-authored-by: jirong <42790011+w-jirong@users.noreply.github.com> Co-authored-by: weizhangqing <weizhangqing@icloudshield.com> Co-authored-by: 王杰 <345127857@qq.com> Co-authored-by: weihubeats <weihubeats@163.com> Co-authored-by: 黄成兴 <49221670+Createsequence@users.noreply.github.com> Co-authored-by: baymax55 <35788491+baymax55@users.noreply.github.com> Co-authored-by: maxisvest <1447829379@qq.com> Co-authored-by: hippo4jbot[bot] <wechat202110@163.com>
parent
703ebecbf6
commit
c8952c67e5
@ -0,0 +1,31 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
target: auto
|
||||
threshold: 0%
|
||||
informational: true
|
||||
patch:
|
||||
default:
|
||||
informational: true
|
||||
ignore:
|
||||
- "hippo4j-example/.*"
|
||||
- "docs/.*"
|
||||
- "dev-support/.*"
|
@ -0,0 +1,56 @@
|
||||
<img align="center" width="300" alt="image" src="https://user-images.githubusercontent.com/77398366/181906454-b46f6a14-7c2c-4b8f-8b0a-40432521bed8.png">
|
||||
|
||||
# Dynamic and observable thread pool framework
|
||||
|
||||
[![Gitee](https://gitee.com/magegoofy/hippo4j/badge/star.svg?theme=gvp)](https://gitee.com/magegoofy/hippo4j) [![GitHub](https://img.shields.io/github/stars/opengoofy/hippo4j?color=5470c6)](https://github.com/opengoofy/hippo4j) [![Contributors](https://img.shields.io/github/contributors/opengoofy/hippo4j?color=3ba272)](https://github.com/opengoofy/hippo4j/graphs/contributors) [![Docker Pulls](https://img.shields.io/docker/pulls/hippo4j/hippo4j-server.svg?label=docker%20pulls&color=fac858)](https://store.docker.com/community/images/hippo4j/hippo4j-server) [![codecov](https://codecov.io/gh/opengoofy/hippo4j/branch/develop/graph/badge.svg?token=WBUVJN107I)](https://codecov.io/gh/opengoofy/hippo4j)
|
||||
|
||||
-------
|
||||
|
||||
## Thread pool pain points
|
||||
|
||||
A thread pool is a tool for managing threads based on the idea of pooling.
|
||||
|
||||
Using a thread pool reduces the overhead of creating and destroying threads and avoids running out of system resources due to too many threads.
|
||||
|
||||
The use of thread pools is essential in highly concurrent and high-volume task processing scenarios.
|
||||
|
||||
If you have actually used thread pools in your projects, I believe you may have encountered the following pain points:
|
||||
|
||||
- Thread pools are defined randomly, with too many thread resources, causing high server load.
|
||||
|
||||
- The thread pool parameters are not easily evaluated and the business is at risk of failure.
|
||||
- Thread pool task execution time exceeds the average execution cycle and developers are not informed.
|
||||
- Thread pool tasks pile up and affect business operations.
|
||||
- Wireless process pool monitoring when the service has timeouts, meltdowns, and other problems.
|
||||
- Thread pools do not support the passing of runtime variables, such as MDC contexts.
|
||||
- When a project is closed, a large number of running thread pool tasks are discarded.
|
||||
- Thread pool running, task execution stopped, don't know the problem.
|
||||
|
||||
## What is Hippo-4J
|
||||
|
||||
Hippo-4J through the JDK thread pool enhancements, as well as extending the three-party framework underlying thread pools and other features for business systems to improve online operational security capabilities.
|
||||
|
||||
The following functional support is provided:
|
||||
|
||||
- Global Control - Managing Application Thread Pool Instances.
|
||||
|
||||
- Dynamic changes - dynamically changing thread pool parameters at application runtime.
|
||||
- Notify alarms - Four built-in alarm notification policies.
|
||||
- Run Monitoring - Real-time view of thread pool runtime data.
|
||||
- Feature extensions - support for thread pooling task passing contexts, etc.
|
||||
- Multiple Modes - Two built-in usage modes: Configuration Center Mode and No Middleware Mode.
|
||||
- Container Management - Tomcat, Jetty, Undertow container thread pool runtime view and thread count changes.
|
||||
- Framework adaptation - Dubbo, Hystrix, Polaris, RabbitMQ, RocketMQ and other consumer thread pool runtime data view and thread count changes.
|
||||
|
||||
## Quick Start
|
||||
|
||||
For local presentation purposes, see [Quick start](https://hippo4j.cn/docs/user_docs/user_guide/quick-start).
|
||||
|
||||
Demo Environment: [http://console.hippo4j.cn/index.html](http://console.hippo4j.cn/index.html).
|
||||
|
||||
## Who is using
|
||||
|
||||
More companies with access are welcome to register at [registration address](https://github.com/opengoofy/hippo4j/issues/13), registration is only for product promotion.
|
||||
|
||||
## Contributors
|
||||
Thanks to all the developers who contributed to the project. If interested in contributing, refer to [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).
|
@ -1,5 +1,5 @@
|
||||
xiaomage:
|
||||
name: 小马哥
|
||||
title: hippo4j 作者
|
||||
url: https://github.com/mabaiwan
|
||||
url: https://github.com/magegoofy
|
||||
image_url: https://avatars.githubusercontent.com/u/77398366?v=4
|
||||
|
@ -0,0 +1,16 @@
|
||||
---
|
||||
id: contributor-guide
|
||||
sidebar_position: 1
|
||||
title: 贡献指南
|
||||
---
|
||||
|
||||
Git Commit Log 尽量使用英文。
|
||||
|
||||
Pull Request 尽量保持单一,不同语义的代码贡献应拆分多个 Pull Request。
|
||||
|
||||
为了让您的 GitHub ID 显示在 Contributor 列表中,别忘了以下设置:
|
||||
|
||||
```shell
|
||||
git config --global user.name "username"
|
||||
git config --global user.email "GitHub 账号邮箱"
|
||||
```
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
title: 代码规约
|
||||
---
|
||||
|
||||
1. 代码提交前,执行 `mvn spotless:apply` 保证代码格式符合规范。
|
||||
2. 代码中不要出现无意义的空行。
|
@ -1,24 +0,0 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# 贡献指南
|
||||
|
||||
Git Commit Log 尽量使用英文。
|
||||
|
||||
Pull Request 尽量保持单一,不同语义的代码贡献应拆分多个 Pull Request。
|
||||
|
||||
为了让您的 GitHub ID 显示在 Contributor 列表中,别忘了以下设置:
|
||||
|
||||
```shell
|
||||
git config --global user.name "username"
|
||||
git config --global user.email "GitHub 账号邮箱"
|
||||
```
|
||||
|
||||
## 贡献者列表
|
||||
|
||||
您可以在 [Hippo4J](https://github.com/opengoofy/hippo4j/graphs/contributors) 和 [Hippo4J Console](https://github.com/opengoofy/hippo4j-console) 的贡献列表中找到全部的贡献者名单。
|
||||
|
||||
<a href="https://github.com/opengoofy/hippo4j/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=opengoofy/hippo4j" />
|
||||
</a>
|
@ -1,21 +0,0 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# 支持开源
|
||||
|
||||
如果您正在使用这个项目并感觉良好,或者是想支持我继续开发。通过以下二维码 一次性捐款,我多半会买一杯咖啡或茶~
|
||||
|
||||
> [GitHub](https://github.com/opengoofy/hippo4j) 或 [Gitee](https://gitee.com/agentart/hippo4j) Star 才是最大动力~
|
||||
|
||||
![](https://images-machen.oss-cn-beijing.aliyuncs.com/IMG_6719_2.jpg?x-oss-process=image/resize,h_180,w_180)
|
||||
|
||||
感谢给予支持的朋友,您的支持是我前进的动力 🎉
|
||||
|
||||
| | ID | 赞赏金额 | 时间 | 备注 |
|
||||
|-----|--------|-------|------------|--------------------|
|
||||
| 1 | 六月飞雪 | 30.00 | 2021-12-30 | 代码设计很优雅的一款框架,继续加油! |
|
||||
| 2 | 孙大圣 | 26.6 | 2022-03-23 | 学习一下😁😁 |
|
||||
| 3 | Easy 点 | 66.00 | 2022-04-09 | 好货好技术当加赏 |
|
||||
| 4 | 捷克 | 30.00 | 2022-05-21 | 非常不错的框架,点赞 |
|
||||
| 5 | 吃猫的饼干 | 88.00 | 2022-08-21 | 👍 |
|
@ -0,0 +1,121 @@
|
||||
---
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# 适配SpringBoot1x
|
||||
|
||||
目前已支持 Nacos、Apollo 配置中心适配 SpringBoot 1.5.x 版本。
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-config-spring-boot-1x-starter</artifactId>
|
||||
<version>1.4.2</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
Nacos SpringBoot 配置如下:
|
||||
|
||||
```yaml
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
ext-config:
|
||||
- data-id: hippo4j-nacos.yaml
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
server-addr: 127.0.0.1:8848
|
||||
dynamic:
|
||||
thread-pool:
|
||||
config-file-type: yml
|
||||
nacos:
|
||||
data-id: hippo4j-nacos.yaml
|
||||
group: DEFAULT_GROUP
|
||||
```
|
||||
|
||||
Apollo SpringBoot 配置如下:
|
||||
|
||||
```yaml
|
||||
apollo:
|
||||
autoUpdateInjectedSpringProperties: true
|
||||
bootstrap:
|
||||
eagerLoad:
|
||||
enabled: true
|
||||
enabled: true
|
||||
namespaces: application
|
||||
meta: http://127.0.0.1:8080
|
||||
app:
|
||||
id: dynamic-threadpool-example
|
||||
spring:
|
||||
dynamic:
|
||||
thread-pool:
|
||||
apollo:
|
||||
namespace: application
|
||||
```
|
||||
|
||||
动态线程池通用配置如下:
|
||||
|
||||
```yaml
|
||||
management:
|
||||
context-path: /actuator
|
||||
security:
|
||||
enabled: false
|
||||
server:
|
||||
port: 8091
|
||||
servlet:
|
||||
context-path: /example
|
||||
spring:
|
||||
application:
|
||||
name: dynamic-threadpool-example
|
||||
dynamic:
|
||||
thread-pool:
|
||||
banner: true
|
||||
check-state-interval: 5
|
||||
collect-type: micrometer
|
||||
config-file-type: properties
|
||||
enable: true
|
||||
executors:
|
||||
- active-alarm: 80
|
||||
alarm: true
|
||||
allow-core-thread-time-out: true
|
||||
blocking-queue: LinkedBlockingQueue
|
||||
capacity-alarm: 80
|
||||
core-pool-size: 1
|
||||
execute-time-out: 1000
|
||||
keep-alive-time: 6691
|
||||
maximum-pool-size: 1
|
||||
notify:
|
||||
interval: 8
|
||||
receives: chen.ma
|
||||
queue-capacity: 1
|
||||
rejected-handler: AbortPolicy
|
||||
thread-name-prefix: message-consume
|
||||
thread-pool-id: message-consume
|
||||
- active-alarm: 80
|
||||
alarm: true
|
||||
allow-core-thread-time-out: true
|
||||
blocking-queue: LinkedBlockingQueue
|
||||
capacity-alarm: 80
|
||||
core-pool-size: 1
|
||||
execute-time-out: 1000
|
||||
keep-alive-time: 6691
|
||||
maximum-pool-size: 1
|
||||
notify:
|
||||
interval: 8
|
||||
receives: chen.ma
|
||||
queue-capacity: 1
|
||||
rejected-handler: AbortPolicy
|
||||
thread-name-prefix: message-produce
|
||||
thread-pool-id: message-produce
|
||||
notify-platforms:
|
||||
- platform: WECHAT
|
||||
token: ac0426a5-c712-474c-9bff-72b8b8f5caff
|
||||
profiles:
|
||||
active: dev
|
||||
```
|
||||
|
||||
具体 Demo 运行请参考以下示例模块,已验证对应线程池动态变更、报警以及运行时监控功能。
|
||||
|
||||
- `/hippo4j-config-nacos-spring-boot-1x-starter-example`
|
||||
- `hippo4j-example/hippo4j-config-apollo-spring-boot-1x-starter-example`
|
@ -0,0 +1,5 @@
|
||||
xiaomage:
|
||||
name: 小马哥
|
||||
title: hippo4j 作者
|
||||
url: https://github.com/magegoofy
|
||||
image_url: https://avatars.githubusercontent.com/u/77398366?v=4
|
@ -0,0 +1,14 @@
|
||||
{
|
||||
"title": {
|
||||
"message": "Blog",
|
||||
"description": "The title for the blog used in SEO"
|
||||
},
|
||||
"description": {
|
||||
"message": "Blog",
|
||||
"description": "The description for the blog used in SEO"
|
||||
},
|
||||
"sidebar.title": {
|
||||
"message": "Recent posts",
|
||||
"description": "The label for the left sidebar"
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
{
|
||||
"version.label": {
|
||||
"message": "Next",
|
||||
"description": "The label for version current"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.社区": {
|
||||
"message": "社区",
|
||||
"description": "The label for category 社区 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.贡献规约": {
|
||||
"message": "贡献规约",
|
||||
"description": "The label for category 贡献规约 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.user_docs": {
|
||||
"message": "user_docs",
|
||||
"description": "The label for category user_docs in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.用户指南": {
|
||||
"message": "用户指南",
|
||||
"description": "The label for category 用户指南 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.用户指南.link.generated-index.description": {
|
||||
"message": "帮助想要了解 Hippo4J 的用户快速掌握核心开发理念。",
|
||||
"description": "The generated-index page description for category 用户指南 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.快速开始": {
|
||||
"message": "快速开始",
|
||||
"description": "The label for category 快速开始 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.依赖配置中心": {
|
||||
"message": "依赖配置中心",
|
||||
"description": "The label for category 依赖配置中心 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.无中间件依赖": {
|
||||
"message": "无中间件依赖",
|
||||
"description": "The label for category 无中间件依赖 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.运维指南": {
|
||||
"message": "运维指南",
|
||||
"description": "The label for category 运维指南 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.开发者手册": {
|
||||
"message": "开发者手册",
|
||||
"description": "The label for category 开发者手册 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.开发者手册.link.generated-index.description": {
|
||||
"message": "Hippo4J 留给使用者能够扩展的知识点。",
|
||||
"description": "The generated-index page description for category 开发者手册 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.其它": {
|
||||
"message": "其它",
|
||||
"description": "The label for category 其它 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.user_docs.category.用户指南": {
|
||||
"message": "用户指南",
|
||||
"description": "The label for category 用户指南 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.用户指南.link.generated-index.description": {
|
||||
"message": "帮助想要了解 Hippo4J 的用户快速掌握核心开发理念。",
|
||||
"description": "The generated-index page description for category 用户指南 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.快速开始": {
|
||||
"message": "快速开始",
|
||||
"description": "The label for category 快速开始 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.依赖配置中心": {
|
||||
"message": "依赖配置中心",
|
||||
"description": "The label for category 依赖配置中心 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.无中间件依赖": {
|
||||
"message": "无中间件依赖",
|
||||
"description": "The label for category 无中间件依赖 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.运维指南": {
|
||||
"message": "运维指南",
|
||||
"description": "The label for category 运维指南 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.开发者手册": {
|
||||
"message": "开发者手册",
|
||||
"description": "The label for category 开发者手册 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.开发者手册.link.generated-index.description": {
|
||||
"message": "Hippo4J 留给使用者能够扩展的知识点。",
|
||||
"description": "The generated-index page description for category 开发者手册 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.其它": {
|
||||
"message": "其它",
|
||||
"description": "The label for category 其它 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.community.category.贡献规约": {
|
||||
"message": "贡献规约",
|
||||
"description": "The label for category 贡献规约 in sidebar community"
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "社区",
|
||||
"position": 1,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
---
|
||||
id: contributor-guide
|
||||
sidebar_position: 1
|
||||
title: 贡献指南
|
||||
---
|
||||
|
||||
Git Commit Log 尽量使用英文。
|
||||
|
||||
Pull Request 尽量保持单一,不同语义的代码贡献应拆分多个 Pull Request。
|
||||
|
||||
为了让您的 GitHub ID 显示在 Contributor 列表中,别忘了以下设置:
|
||||
|
||||
```shell
|
||||
git config --global user.name "username"
|
||||
git config --global user.email "GitHub 账号邮箱"
|
||||
```
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "贡献规约",
|
||||
"position": 2,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
{
|
||||
"version.label": {
|
||||
"message": "Next",
|
||||
"description": "The label for version current"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.社区": {
|
||||
"message": "社区",
|
||||
"description": "The label for category 社区 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.贡献规约": {
|
||||
"message": "贡献规约",
|
||||
"description": "The label for category 贡献规约 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.user_docs": {
|
||||
"message": "user_docs",
|
||||
"description": "The label for category user_docs in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.用户指南": {
|
||||
"message": "用户指南",
|
||||
"description": "The label for category 用户指南 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.用户指南.link.generated-index.description": {
|
||||
"message": "帮助想要了解 Hippo4J 的用户快速掌握核心开发理念。",
|
||||
"description": "The generated-index page description for category 用户指南 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.快速开始": {
|
||||
"message": "快速开始",
|
||||
"description": "The label for category 快速开始 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.依赖配置中心": {
|
||||
"message": "依赖配置中心",
|
||||
"description": "The label for category 依赖配置中心 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.无中间件依赖": {
|
||||
"message": "无中间件依赖",
|
||||
"description": "The label for category 无中间件依赖 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.运维指南": {
|
||||
"message": "运维指南",
|
||||
"description": "The label for category 运维指南 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.开发者手册": {
|
||||
"message": "开发者手册",
|
||||
"description": "The label for category 开发者手册 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.开发者手册.link.generated-index.description": {
|
||||
"message": "Hippo4J 留给使用者能够扩展的知识点。",
|
||||
"description": "The generated-index page description for category 开发者手册 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.tutorialSidebar.category.其它": {
|
||||
"message": "其它",
|
||||
"description": "The label for category 其它 in sidebar tutorialSidebar"
|
||||
},
|
||||
"sidebar.user_docs.category.用户指南": {
|
||||
"message": "用户指南",
|
||||
"description": "The label for category 用户指南 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.用户指南.link.generated-index.description": {
|
||||
"message": "帮助想要了解 Hippo4J 的用户快速掌握核心开发理念。",
|
||||
"description": "The generated-index page description for category 用户指南 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.快速开始": {
|
||||
"message": "快速开始",
|
||||
"description": "The label for category 快速开始 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.依赖配置中心": {
|
||||
"message": "依赖配置中心",
|
||||
"description": "The label for category 依赖配置中心 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.无中间件依赖": {
|
||||
"message": "无中间件依赖",
|
||||
"description": "The label for category 无中间件依赖 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.运维指南": {
|
||||
"message": "运维指南",
|
||||
"description": "The label for category 运维指南 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.开发者手册": {
|
||||
"message": "开发者手册",
|
||||
"description": "The label for category 开发者手册 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.开发者手册.link.generated-index.description": {
|
||||
"message": "Hippo4J 留给使用者能够扩展的知识点。",
|
||||
"description": "The generated-index page description for category 开发者手册 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.user_docs.category.其它": {
|
||||
"message": "其它",
|
||||
"description": "The label for category 其它 in sidebar user_docs"
|
||||
},
|
||||
"sidebar.community.category.贡献规约": {
|
||||
"message": "贡献规约",
|
||||
"description": "The label for category 贡献规约 in sidebar community"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "开发者手册",
|
||||
"position": 5,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Hippo4J 留给使用者能够扩展的知识点。"
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
---
|
||||
sidebar_position: 0
|
||||
---
|
||||
|
||||
# 内置拒绝策略
|
||||
|
||||
内置两种拒绝策略说明:
|
||||
|
||||
**RunsOldestTaskPolicy**:添加新任务并由主线程运行最早的任务。
|
||||
|
||||
```java
|
||||
public class RunsOldestTaskPolicy implements RejectedExecutionHandler {
|
||||
|
||||
@Override
|
||||
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
|
||||
if (executor.isShutdown()) {
|
||||
return;
|
||||
}
|
||||
BlockingQueue<Runnable> workQueue = executor.getQueue();
|
||||
Runnable firstWork = workQueue.poll();
|
||||
boolean newTaskAdd = workQueue.offer(r);
|
||||
if (firstWork != null) {
|
||||
firstWork.run();
|
||||
}
|
||||
if (!newTaskAdd) {
|
||||
executor.execute(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**SyncPutQueuePolicy**:主线程把拒绝任务以阻塞的方式添加到队列。
|
||||
|
||||
```java
|
||||
@Slf4j
|
||||
public class SyncPutQueuePolicy implements RejectedExecutionHandler {
|
||||
|
||||
@Override
|
||||
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
|
||||
if (executor.isShutdown()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
executor.getQueue().put(r);
|
||||
} catch (InterruptedException e) {
|
||||
log.error("Adding Queue task to thread pool failed.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "快速开始",
|
||||
"position": 3,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"label": "依赖配置中心",
|
||||
"position": 2,
|
||||
"collapsed": true
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# 参数默认配置
|
||||
|
||||
曾有多名小伙伴反馈说,项目中线程池一多,配置文件中配置就显得很臃肿。为此 hippo4j-config 开发出了动态线程池默认配置。
|
||||
|
||||
```yaml
|
||||
spring:
|
||||
dynamic:
|
||||
thread-pool:
|
||||
default-executor:
|
||||
core-pool-size: 4
|
||||
maximum-pool-size: 6
|
||||
blocking-queue: ResizableCapacityLinkedBlockingQueue
|
||||
queue-capacity: 1024
|
||||
execute-time-out: 1000
|
||||
keep-alive-time: 9999
|
||||
rejected-handler: AbortPolicy
|
||||
active-alarm: 90
|
||||
capacity-alarm: 85
|
||||
alarm: true
|
||||
allow-core-thread-time-out: true
|
||||
notify:
|
||||
interval: 5
|
||||
receives: chen.ma
|
||||
executors:
|
||||
- thread-pool-id: message-produce
|
||||
- thread-pool-id: message-consume
|
||||
core-pool-size: 80
|
||||
maximum-pool-size: 100
|
||||
execute-time-out: 1000
|
||||
notify:
|
||||
interval: 6
|
||||
receives: chen.ma
|
||||
```
|
||||
|
||||
`spring.dynamic.thread-pool.executors` 层级下,仅需要配置 `thread-pool-id`,其余配置从 `spring.dynamic.thread-pool.default-executor` 读取。
|
||||
|
||||
如果 `spring.dynamic.thread-pool.executors` 下配置和 `spring.dynamic.thread-pool.default-executor` 冲突,以前者为主。
|
||||
|
||||
通过该自定义配置方式,可减少大量重复线程池参数配置项,提高核心配置简洁度。
|
||||
|
||||
提示:`spring.dynamic.thread-pool.default-executor` 层级下参数,不提供动态刷新功能。
|
@ -0,0 +1,121 @@
|
||||
---
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# 适配SpringBoot1x
|
||||
|
||||
目前已支持 Nacos、Apollo 配置中心适配 SpringBoot 1.5.x 版本。
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-config-spring-boot-1x-starter</artifactId>
|
||||
<version>1.4.2</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
Nacos SpringBoot 配置如下:
|
||||
|
||||
```yaml
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
ext-config:
|
||||
- data-id: hippo4j-nacos.yaml
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
server-addr: 127.0.0.1:8848
|
||||
dynamic:
|
||||
thread-pool:
|
||||
config-file-type: yml
|
||||
nacos:
|
||||
data-id: hippo4j-nacos.yaml
|
||||
group: DEFAULT_GROUP
|
||||
```
|
||||
|
||||
Apollo SpringBoot 配置如下:
|
||||
|
||||
```yaml
|
||||
apollo:
|
||||
autoUpdateInjectedSpringProperties: true
|
||||
bootstrap:
|
||||
eagerLoad:
|
||||
enabled: true
|
||||
enabled: true
|
||||
namespaces: application
|
||||
meta: http://127.0.0.1:8080
|
||||
app:
|
||||
id: dynamic-threadpool-example
|
||||
spring:
|
||||
dynamic:
|
||||
thread-pool:
|
||||
apollo:
|
||||
namespace: application
|
||||
```
|
||||
|
||||
动态线程池通用配置如下:
|
||||
|
||||
```yaml
|
||||
management:
|
||||
context-path: /actuator
|
||||
security:
|
||||
enabled: false
|
||||
server:
|
||||
port: 8091
|
||||
servlet:
|
||||
context-path: /example
|
||||
spring:
|
||||
application:
|
||||
name: dynamic-threadpool-example
|
||||
dynamic:
|
||||
thread-pool:
|
||||
banner: true
|
||||
check-state-interval: 5
|
||||
collect-type: micrometer
|
||||
config-file-type: properties
|
||||
enable: true
|
||||
executors:
|
||||
- active-alarm: 80
|
||||
alarm: true
|
||||
allow-core-thread-time-out: true
|
||||
blocking-queue: LinkedBlockingQueue
|
||||
capacity-alarm: 80
|
||||
core-pool-size: 1
|
||||
execute-time-out: 1000
|
||||
keep-alive-time: 6691
|
||||
maximum-pool-size: 1
|
||||
notify:
|
||||
interval: 8
|
||||
receives: chen.ma
|
||||
queue-capacity: 1
|
||||
rejected-handler: AbortPolicy
|
||||
thread-name-prefix: message-consume
|
||||
thread-pool-id: message-consume
|
||||
- active-alarm: 80
|
||||
alarm: true
|
||||
allow-core-thread-time-out: true
|
||||
blocking-queue: LinkedBlockingQueue
|
||||
capacity-alarm: 80
|
||||
core-pool-size: 1
|
||||
execute-time-out: 1000
|
||||
keep-alive-time: 6691
|
||||
maximum-pool-size: 1
|
||||
notify:
|
||||
interval: 8
|
||||
receives: chen.ma
|
||||
queue-capacity: 1
|
||||
rejected-handler: AbortPolicy
|
||||
thread-name-prefix: message-produce
|
||||
thread-pool-id: message-produce
|
||||
notify-platforms:
|
||||
- platform: WECHAT
|
||||
token: ac0426a5-c712-474c-9bff-72b8b8f5caff
|
||||
profiles:
|
||||
active: dev
|
||||
```
|
||||
|
||||
具体 Demo 运行请参考以下示例模块,已验证对应线程池动态变更、报警以及运行时监控功能。
|
||||
|
||||
- `/hippo4j-config-nacos-spring-boot-1x-starter-example`
|
||||
- `hippo4j-example/hippo4j-config-apollo-spring-boot-1x-starter-example`
|
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 730 KiB |
After Width: | Height: | Size: 27 KiB |
@ -0,0 +1,5 @@
|
||||
{
|
||||
"label": "无中间件依赖",
|
||||
"position": 3,
|
||||
"collapsed": true
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "运维指南",
|
||||
"position": 4,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "其它",
|
||||
"position": 6,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# 加群沟通
|
||||
|
||||
扫码添加微信,备注:`hippo4j`,邀您加入群聊。
|
||||
|
||||
![](https://images-machen.oss-cn-beijing.aliyuncs.com/185774220-c11951f9-e130-4d60-8204-afb5c51d4401.png)
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "用户指南",
|
||||
"position": 2,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "帮助想要了解 Hippo4J 的用户快速掌握核心开发理念。"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "开发者手册",
|
||||
"position": 5,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Hippo4J 留给使用者能够扩展的知识点。"
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
---
|
||||
sidebar_position: 0
|
||||
---
|
||||
|
||||
# 内置拒绝策略
|
||||
|
||||
内置两种拒绝策略说明:
|
||||
|
||||
**RunsOldestTaskPolicy**:添加新任务并由主线程运行最早的任务。
|
||||
|
||||
```java
|
||||
public class RunsOldestTaskPolicy implements RejectedExecutionHandler {
|
||||
|
||||
@Override
|
||||
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
|
||||
if (executor.isShutdown()) {
|
||||
return;
|
||||
}
|
||||
BlockingQueue<Runnable> workQueue = executor.getQueue();
|
||||
Runnable firstWork = workQueue.poll();
|
||||
boolean newTaskAdd = workQueue.offer(r);
|
||||
if (firstWork != null) {
|
||||
firstWork.run();
|
||||
}
|
||||
if (!newTaskAdd) {
|
||||
executor.execute(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**SyncPutQueuePolicy**:主线程把拒绝任务以阻塞的方式添加到队列。
|
||||
|
||||
```java
|
||||
@Slf4j
|
||||
public class SyncPutQueuePolicy implements RejectedExecutionHandler {
|
||||
|
||||
@Override
|
||||
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
|
||||
if (executor.isShutdown()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
executor.getQueue().put(r);
|
||||
} catch (InterruptedException e) {
|
||||
log.error("Adding Queue task to thread pool failed.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "快速开始",
|
||||
"position": 3,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"label": "依赖配置中心",
|
||||
"position": 2,
|
||||
"collapsed": true
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# 参数默认配置
|
||||
|
||||
曾有多名小伙伴反馈说,项目中线程池一多,配置文件中配置就显得很臃肿。为此 hippo4j-config 开发出了动态线程池默认配置。
|
||||
|
||||
```yaml
|
||||
spring:
|
||||
dynamic:
|
||||
thread-pool:
|
||||
default-executor:
|
||||
core-pool-size: 4
|
||||
maximum-pool-size: 6
|
||||
blocking-queue: ResizableCapacityLinkedBlockingQueue
|
||||
queue-capacity: 1024
|
||||
execute-time-out: 1000
|
||||
keep-alive-time: 9999
|
||||
rejected-handler: AbortPolicy
|
||||
active-alarm: 90
|
||||
capacity-alarm: 85
|
||||
alarm: true
|
||||
allow-core-thread-time-out: true
|
||||
notify:
|
||||
interval: 5
|
||||
receives: chen.ma
|
||||
executors:
|
||||
- thread-pool-id: message-produce
|
||||
- thread-pool-id: message-consume
|
||||
core-pool-size: 80
|
||||
maximum-pool-size: 100
|
||||
execute-time-out: 1000
|
||||
notify:
|
||||
interval: 6
|
||||
receives: chen.ma
|
||||
```
|
||||
|
||||
`spring.dynamic.thread-pool.executors` 层级下,仅需要配置 `thread-pool-id`,其余配置从 `spring.dynamic.thread-pool.default-executor` 读取。
|
||||
|
||||
如果 `spring.dynamic.thread-pool.executors` 下配置和 `spring.dynamic.thread-pool.default-executor` 冲突,以前者为主。
|
||||
|
||||
通过该自定义配置方式,可减少大量重复线程池参数配置项,提高核心配置简洁度。
|
||||
|
||||
提示:`spring.dynamic.thread-pool.default-executor` 层级下参数,不提供动态刷新功能。
|
@ -0,0 +1,121 @@
|
||||
---
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# 适配SpringBoot1x
|
||||
|
||||
目前已支持 Nacos、Apollo 配置中心适配 SpringBoot 1.5.x 版本。
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-config-spring-boot-1x-starter</artifactId>
|
||||
<version>1.4.2</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
Nacos SpringBoot 配置如下:
|
||||
|
||||
```yaml
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
ext-config:
|
||||
- data-id: hippo4j-nacos.yaml
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
server-addr: 127.0.0.1:8848
|
||||
dynamic:
|
||||
thread-pool:
|
||||
config-file-type: yml
|
||||
nacos:
|
||||
data-id: hippo4j-nacos.yaml
|
||||
group: DEFAULT_GROUP
|
||||
```
|
||||
|
||||
Apollo SpringBoot 配置如下:
|
||||
|
||||
```yaml
|
||||
apollo:
|
||||
autoUpdateInjectedSpringProperties: true
|
||||
bootstrap:
|
||||
eagerLoad:
|
||||
enabled: true
|
||||
enabled: true
|
||||
namespaces: application
|
||||
meta: http://127.0.0.1:8080
|
||||
app:
|
||||
id: dynamic-threadpool-example
|
||||
spring:
|
||||
dynamic:
|
||||
thread-pool:
|
||||
apollo:
|
||||
namespace: application
|
||||
```
|
||||
|
||||
动态线程池通用配置如下:
|
||||
|
||||
```yaml
|
||||
management:
|
||||
context-path: /actuator
|
||||
security:
|
||||
enabled: false
|
||||
server:
|
||||
port: 8091
|
||||
servlet:
|
||||
context-path: /example
|
||||
spring:
|
||||
application:
|
||||
name: dynamic-threadpool-example
|
||||
dynamic:
|
||||
thread-pool:
|
||||
banner: true
|
||||
check-state-interval: 5
|
||||
collect-type: micrometer
|
||||
config-file-type: properties
|
||||
enable: true
|
||||
executors:
|
||||
- active-alarm: 80
|
||||
alarm: true
|
||||
allow-core-thread-time-out: true
|
||||
blocking-queue: LinkedBlockingQueue
|
||||
capacity-alarm: 80
|
||||
core-pool-size: 1
|
||||
execute-time-out: 1000
|
||||
keep-alive-time: 6691
|
||||
maximum-pool-size: 1
|
||||
notify:
|
||||
interval: 8
|
||||
receives: chen.ma
|
||||
queue-capacity: 1
|
||||
rejected-handler: AbortPolicy
|
||||
thread-name-prefix: message-consume
|
||||
thread-pool-id: message-consume
|
||||
- active-alarm: 80
|
||||
alarm: true
|
||||
allow-core-thread-time-out: true
|
||||
blocking-queue: LinkedBlockingQueue
|
||||
capacity-alarm: 80
|
||||
core-pool-size: 1
|
||||
execute-time-out: 1000
|
||||
keep-alive-time: 6691
|
||||
maximum-pool-size: 1
|
||||
notify:
|
||||
interval: 8
|
||||
receives: chen.ma
|
||||
queue-capacity: 1
|
||||
rejected-handler: AbortPolicy
|
||||
thread-name-prefix: message-produce
|
||||
thread-pool-id: message-produce
|
||||
notify-platforms:
|
||||
- platform: WECHAT
|
||||
token: ac0426a5-c712-474c-9bff-72b8b8f5caff
|
||||
profiles:
|
||||
active: dev
|
||||
```
|
||||
|
||||
具体 Demo 运行请参考以下示例模块,已验证对应线程池动态变更、报警以及运行时监控功能。
|
||||
|
||||
- `/hippo4j-config-nacos-spring-boot-1x-starter-example`
|
||||
- `hippo4j-example/hippo4j-config-apollo-spring-boot-1x-starter-example`
|
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 730 KiB |
After Width: | Height: | Size: 27 KiB |
@ -0,0 +1,5 @@
|
||||
{
|
||||
"label": "无中间件依赖",
|
||||
"position": 3,
|
||||
"collapsed": true
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "运维指南",
|
||||
"position": 4,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"label": "其它",
|
||||
"position": 6,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue