补丁
This commit is contained in:
parent
64bbc029d9
commit
69587e9fac
9
pom.xml
9
pom.xml
@ -17,8 +17,8 @@
|
|||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
||||||
<spring-boot.version>3.3.4</spring-boot.version>
|
<spring-boot.version>3.3.5</spring-boot.version>
|
||||||
<druid.version>1.2.21</druid.version>
|
<druid.version>1.2.23</druid.version>
|
||||||
<dynamic.version>3.5.2</dynamic.version>
|
<dynamic.version>3.5.2</dynamic.version>
|
||||||
<transactions.version>6.0.0</transactions.version>
|
<transactions.version>6.0.0</transactions.version>
|
||||||
<jta.version>1.1</jta.version>
|
<jta.version>1.1</jta.version>
|
||||||
@ -31,13 +31,14 @@
|
|||||||
<oshi.version>6.6.3</oshi.version>
|
<oshi.version>6.6.3</oshi.version>
|
||||||
<commons.io.version>2.17.0</commons.io.version>
|
<commons.io.version>2.17.0</commons.io.version>
|
||||||
<commons.collections.version>3.2.2</commons.collections.version>
|
<commons.collections.version>3.2.2</commons.collections.version>
|
||||||
<poi.version>5.2.3</poi.version>
|
<poi.version>5.3.0</poi.version>
|
||||||
<httpclient.version>4.5.14</httpclient.version>
|
<httpclient.version>4.5.14</httpclient.version>
|
||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
<jwt.version>0.12.5</jwt.version>
|
<jwt.version>0.12.5</jwt.version>
|
||||||
<knife4j.version>4.5.0</knife4j.version>
|
<knife4j.version>4.5.0</knife4j.version>
|
||||||
<mybatis-spring-boot.version>3.0.3</mybatis-spring-boot.version>
|
<mybatis-spring-boot.version>3.0.3</mybatis-spring-boot.version>
|
||||||
<mysql.version>8.2.0</mysql.version>
|
<!-- druid 的 xa暂时不支持 mysql 9.0.0+ -->
|
||||||
|
<mysql.version>8.4.0</mysql.version>
|
||||||
<jaxb-api.version>2.3.1</jaxb-api.version>
|
<jaxb-api.version>2.3.1</jaxb-api.version>
|
||||||
<jaxb.version>4.0.5</jaxb.version>
|
<jaxb.version>4.0.5</jaxb.version>
|
||||||
<springdoc.version>2.1.0</springdoc.version>
|
<springdoc.version>2.1.0</springdoc.version>
|
||||||
|
7
ruoyi-admin/src/main/resources/application-lp.yml
Normal file
7
ruoyi-admin/src/main/resources/application-lp.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
netty:
|
||||||
|
websocket:
|
||||||
|
maxMessageSize: 65536
|
||||||
|
bossThreads: 4
|
||||||
|
workerThreads: 16
|
||||||
|
port: 8081
|
||||||
|
enable: true
|
@ -69,7 +69,7 @@ spring:
|
|||||||
# 国际化资源文件路径
|
# 国际化资源文件路径
|
||||||
basename: i18n/messages
|
basename: i18n/messages
|
||||||
profiles:
|
profiles:
|
||||||
active: druid,mybatis,auth,pay,middleware
|
active: druid,mybatis,auth,pay,middleware,lp
|
||||||
# 文件上传
|
# 文件上传
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
|
@ -57,6 +57,12 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql驱动包 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 获取系统信息 -->
|
<!-- 获取系统信息 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.oshi</groupId>
|
<groupId>com.github.oshi</groupId>
|
||||||
|
@ -38,27 +38,27 @@ public class DynamicDataSourceProperties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Properties build(DataSourceProperties dataSourceProperties) {
|
public Properties build(DataSourceProperties dataSourceProperties) {
|
||||||
Properties prop = new Properties();
|
Properties prop = new Properties();
|
||||||
DruidProperties druidProperties = SpringUtils.getBean(DruidProperties.class);
|
DruidProperties druidProperties = SpringUtils.getBean(DruidProperties.class);
|
||||||
prop.put("url", dataSourceProperties.getUrl());
|
prop.setProperty("url", dataSourceProperties.getUrl());
|
||||||
prop.put("username", dataSourceProperties.getUsername());
|
prop.setProperty("username", dataSourceProperties.getUsername());
|
||||||
prop.put("password", dataSourceProperties.getPassword());
|
prop.setProperty("password", dataSourceProperties.getPassword());
|
||||||
prop.put("initialSize", druidProperties.getInitialSize());
|
prop.setProperty("initialSize", String.valueOf(druidProperties.getInitialSize()));
|
||||||
prop.put("minIdle", druidProperties.getMinIdle());
|
prop.setProperty("minIdle", String.valueOf(druidProperties.getMinIdle()));
|
||||||
prop.put("maxActive", druidProperties.getMaxActive());
|
prop.setProperty("maxActive", String.valueOf(druidProperties.getMaxActive()));
|
||||||
prop.put("maxWait", druidProperties.getMaxWait());
|
prop.setProperty("maxWait", String.valueOf(druidProperties.getMaxWait()));
|
||||||
prop.put("timeBetweenEvictionRunsMillis", druidProperties.getTimeBetweenEvictionRunsMillis());
|
prop.setProperty("timeBetweenEvictionRunsMillis", String.valueOf(druidProperties.getTimeBetweenEvictionRunsMillis()));
|
||||||
prop.put("minEvictableIdleTimeMillis", druidProperties.getMinEvictableIdleTimeMillis());
|
prop.setProperty("minEvictableIdleTimeMillis", String.valueOf(druidProperties.getMinEvictableIdleTimeMillis()));
|
||||||
prop.put("maxEvictableIdleTimeMillis", druidProperties.getMaxEvictableIdleTimeMillis());
|
prop.setProperty("maxEvictableIdleTimeMillis", String.valueOf(druidProperties.getMaxEvictableIdleTimeMillis()));
|
||||||
prop.put("validationQuery", druidProperties.getValidationQuery());
|
prop.setProperty("validationQuery", druidProperties.getValidationQuery());
|
||||||
prop.put("testWhileIdle", druidProperties.isTestWhileIdle());
|
prop.setProperty("testWhileIdle", String.valueOf(druidProperties.isTestWhileIdle()));
|
||||||
prop.put("testOnBorrow", druidProperties.isTestOnBorrow());
|
prop.setProperty("testOnBorrow", String.valueOf(druidProperties.isTestOnBorrow()));
|
||||||
prop.put("testOnReturn", druidProperties.isTestOnReturn());
|
prop.setProperty("testOnReturn", String.valueOf(druidProperties.isTestOnReturn()));
|
||||||
return prop;
|
return prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setProperties(DruidDataSource dataSource, Properties prop) {
|
public void setProperties(DruidDataSource dataSource, Properties prop) {
|
||||||
dataSource.setUrl(prop.getProperty("url"));
|
dataSource.setUrl(prop.getProperty("url"));
|
||||||
dataSource.setUsername(prop.getProperty("username"));
|
dataSource.setUsername(prop.getProperty("username"));
|
||||||
dataSource.setPassword(prop.getProperty("password"));
|
dataSource.setPassword(prop.getProperty("password"));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.ruoyi.framework.config;
|
package com.ruoyi.framework.datasource;
|
||||||
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
@ -12,8 +12,11 @@ import org.springframework.context.annotation.DependsOn;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.alibaba.druid.pool.xa.DruidXADataSource;
|
import com.alibaba.druid.pool.xa.DruidXADataSource;
|
||||||
import com.atomikos.jdbc.AtomikosDataSourceBean;
|
import com.atomikos.spring.AtomikosDataSourceBean;
|
||||||
import com.ruoyi.common.service.datasource.CreateDataSource;
|
import com.ruoyi.common.service.datasource.CreateDataSource;
|
||||||
|
import com.ruoyi.framework.config.AtomikosConfig;
|
||||||
|
import com.ruoyi.framework.config.DruidConfig;
|
||||||
|
import com.ruoyi.framework.config.DynamicDataSourceProperties;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@DependsOn({ "transactionManager" })
|
@DependsOn({ "transactionManager" })
|
||||||
@ -36,13 +39,16 @@ public class AtomikosDataSourceCreate implements CreateDataSource {
|
|||||||
dataSource.setConnectProperties(prop);
|
dataSource.setConnectProperties(prop);
|
||||||
properties.setProperties(dataSource, prop);
|
properties.setProperties(dataSource, prop);
|
||||||
AtomikosDataSourceBean ds = new AtomikosDataSourceBean();
|
AtomikosDataSourceBean ds = new AtomikosDataSourceBean();
|
||||||
|
|
||||||
atomikosConfig.getAtomikosDataSourceBeans().add(ds);
|
atomikosConfig.getAtomikosDataSourceBeans().add(ds);
|
||||||
ds.setXaDataSourceClassName("com.alibaba.druid.pool.xa.DruidXADataSource");
|
ds.setXaDataSourceClassName("com.alibaba.druid.pool.xa.DruidXADataSource");
|
||||||
ds.setUniqueResourceName(name);
|
ds.setUniqueResourceName(name);
|
||||||
ds.setXaProperties(prop);
|
|
||||||
ds.setXaDataSource(dataSource);
|
ds.setXaDataSource(dataSource);
|
||||||
|
ds.setXaProperties(prop);
|
||||||
|
ds.setMaxPoolSize(dataSource.getMaxActive());
|
||||||
|
ds.setMinPoolSize(dataSource.getMinIdle());
|
||||||
properties.validateDataSource(ds);
|
properties.validateDataSource(ds);
|
||||||
logger.info("数据源:{} 链接成功", name);
|
logger.info("数据源:{} 链接成功", name);
|
||||||
return ds;
|
return dataSource;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -4,11 +4,8 @@ import java.util.Map;
|
|||||||
|
|
||||||
import io.netty.channel.ChannelFutureListener;
|
import io.netty.channel.ChannelFutureListener;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.group.ChannelGroup;
|
|
||||||
import io.netty.channel.group.DefaultChannelGroup;
|
|
||||||
import io.netty.handler.codec.http.FullHttpMessage;
|
import io.netty.handler.codec.http.FullHttpMessage;
|
||||||
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
||||||
import io.netty.util.concurrent.GlobalEventExecutor;
|
|
||||||
|
|
||||||
public abstract class NettyWebSocketEndpointHandler {
|
public abstract class NettyWebSocketEndpointHandler {
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.ruoyi.netty.websocket.nettyServer.handler.WebSocketHandler;
|
import com.ruoyi.netty.websocket.nettyServer.handler.WebSocketHandler;
|
||||||
|
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
@ -59,6 +60,6 @@ public class NettyWebSocketServer {
|
|||||||
System.out.println(
|
System.out.println(
|
||||||
"----------------------------------------------------------------------------------- \n Arknights!");
|
"----------------------------------------------------------------------------------- \n Arknights!");
|
||||||
NettyWebSocketServer.serverBootstrap = serverBootstrap;
|
NettyWebSocketServer.serverBootstrap = serverBootstrap;
|
||||||
return serverBootstrap;
|
return NettyWebSocketServer.serverBootstrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,6 @@
|
|||||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.netty</groupId>
|
|
||||||
<artifactId>netty-all</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
Loading…
Reference in New Issue
Block a user