rev: TLOG与dynamictp相关配置更改

This commit is contained in:
ludj
2024-07-19 14:32:53 +08:00
parent 7473d0b67c
commit 10ae76963f
9 changed files with 49 additions and 31 deletions

View File

@@ -3,5 +3,7 @@
<component name="Encoding">
<file url="file://$PROJECT_DIR$/nladmin-system/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/nladmin-system/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

View File

@@ -28,6 +28,13 @@
</properties>
<dependencies>
<dependency>
<groupId>org.dromara.dynamictp</groupId>
<artifactId>dynamic-tp-spring-boot-starter-adapter-webserver</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>

View File

@@ -1,12 +1,8 @@
package org.nl;
import cn.dev33.satoken.annotation.SaIgnore;
import org.dromara.dynamictp.core.spring.EnableDynamicTp;
import org.mybatis.spring.annotation.MapperScan;
import org.nl.common.utils.SpringContextHolder;
import org.nl.common.websocket.heartSocket.clientSocket.HeartClientServer;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.support.AbstractBeanFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -14,14 +10,11 @@ import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactor
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.net.InetSocketAddress;
/**
* 开启审计功能 -> @EnableJpaAuditing
* https://www.cnblogs.com/niceyoo/p/10908647.html
@@ -37,6 +30,7 @@ import java.net.InetSocketAddress;
@ServletComponentScan
@EnableTransactionManagement
@MapperScan("org.nl.**.mapper")
@EnableDynamicTp
public class AppRun implements CommandLineRunner {
public static void main(String[] args) {
SpringApplication.run(AppRun.class, args);
@@ -54,12 +48,12 @@ public class AppRun implements CommandLineRunner {
// return new SpringContextHolder();
// }
@Bean
/*@Bean
public ServletWebServerFactory webServerFactory() {
TomcatServletWebServerFactory fa = new TomcatServletWebServerFactory();
fa.addConnectorCustomizers(connector -> connector.setProperty("relaxedQueryChars", "[]{}"));
return fa;
}
}*/
/**
* 访问首页提示
@@ -69,6 +63,11 @@ public class AppRun implements CommandLineRunner {
@GetMapping("/")
@SaIgnore
public String index() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return "Backend service started successfully";
}
}

View File

@@ -1,19 +1,21 @@
package org.nl.wms.system_manage.service.quartz.utils;
import cn.hutool.core.util.StrUtil;
import com.yomahub.tlog.core.thread.TLogInheritableTask;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.utils.SpringContextHolder;
import org.springframework.util.ReflectionUtils;
import java.lang.reflect.Method;
import java.util.concurrent.Callable;
/**
* 执行定时任务
*
* @author /
*/
@Slf4j
public class QuartzRunnable implements Callable {
public class QuartzRunnable extends TLogInheritableTask {
private final Object target;
private final Method method;
@@ -31,14 +33,15 @@ public class QuartzRunnable implements Callable {
}
}
@SneakyThrows
@Override
public Object call() throws Exception {
public void runTask() {
ReflectionUtils.makeAccessible(method);
if (StrUtil.isNotEmpty(params)) {
method.invoke(target, params);
} else {
method.invoke(target);
}
return null;
}
}

View File

@@ -1,10 +0,0 @@
测试创建文件
测试修改
123123221322313

View File

@@ -1,11 +1,6 @@
server:
port: 8012
max-http-header-size: 65536
tomcat:
accept-count: 300
threads:
max: 300
min-spare: 30
#配置数据源
spring:
datasource:
@@ -158,6 +153,7 @@ sa-token:
# 配置 Cookie 作用域:根据二级域名实现sso登入如lms.sso.com;acs.sso.com
domain:
is-read-cookie: false
is-print: false
schedulerFile: /Users/mima0000/Desktop/scheduler.xml
lucene:
index:

View File

@@ -1,3 +1,7 @@
server:
tomcat:
relaxed-query-chars: [ '|','{','}','[',']' ] #字符问题https://blog.csdn.net/CanYue_Yi/article/details/109182577
relaxed-path-chars: [ '|','{','}','[',']' ] #字符问题: https://blog.csdn.net/weixin_41996632/article/details/90715118
spring:
freemarker:
check-template-location: false
@@ -9,6 +13,21 @@ spring:
redis:
repositories:
enabled: false
dynamic:
tp:
enabled: true # 是否启用 dynamictp默认true
enabledBanner: false # 是否启用 控制台banner默认true
enabledCollect: true # 是否开启监控指标采集默认true
collectorTypes: logging # 监控数据采集器类型logging | micrometer | internal_logging默认micrometer
logPath: d:\log\lms # 监控日志数据路径,默认 ${user.home}/logs采集类型非logging不用配置
monitorInterval: 8
tomcatTp: # tomcat webserver 线程池配置
threadPoolAliasName: tomcat 线程池 # 线程池别名,可选
corePoolSize: 15
tryInterrupt: false
maximumPoolSize: 100
keepAliveTime: 60
runTimeout: 5000
task:
pool:
# 核心线程池大小
@@ -91,3 +110,6 @@ pageheiper:
supportMethodsArguments: true
pageSizeZero: false #pageSize=0 返回所有
params: count=countSgl
tlog:
enable-invoke-time-print: true
pattern: "[$traceId]"

View File

@@ -79,8 +79,8 @@
<!--开发环境:打印控制台-->
<springProfile name="dev3">
<root level="info">
<appender-ref ref="asyncLuceneAppender"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="asyncLuceneAppender"/>
</root>
<logger name="jdbc" level="ERROR" additivity="true">
<appender-ref ref="asyncFileAppender"/>

View File

@@ -1 +0,0 @@
123213213