Commit 773b0433 authored by zhangc's avatar zhangc

修改sentinel限流配置

parent d1f3e7bf
...@@ -8,9 +8,7 @@ import com.alibaba.csp.sentinel.slots.block.flow.FlowRule; ...@@ -8,9 +8,7 @@ import com.alibaba.csp.sentinel.slots.block.flow.FlowRule;
import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager; import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -23,7 +21,7 @@ import java.util.List; ...@@ -23,7 +21,7 @@ import java.util.List;
* @DAY_NAME_SHORT: 周四 * @DAY_NAME_SHORT: 周四
* @Description: 限流熔断初始化配置 * @Description: 限流熔断初始化配置
**/ **/
@Configuration //@Configuration
public class SentinelConfig { public class SentinelConfig {
@Bean @Bean
public SentinelResourceAspect sentinelResourceAspect() { public SentinelResourceAspect sentinelResourceAspect() {
...@@ -41,7 +39,7 @@ public class SentinelConfig { ...@@ -41,7 +39,7 @@ public class SentinelConfig {
@Value("${sentinel.resource}") @Value("${sentinel.resource}")
private String limitSource ; private String limitSource ;
@PostConstruct //@PostConstruct
private void initFlowRules() { private void initFlowRules() {
List<FlowRule> rules = new ArrayList<>(); List<FlowRule> rules = new ArrayList<>();
......
package com.jz.dm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jz.dm.models.domian.ApiSyncingDatasource;
/**api数据源配置信息表 mapper
* @author ybz
*
*/
public interface ApiSyncingDatasourceMapper extends BaseMapper<ApiSyncingDatasource> {
}
package com.jz.dm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jz.dm.models.domian.ApiSyncingDatasourceType;
/**api数据源类型信息表 mapper
* @author ybz
*
*/
public interface ApiSyncingDatasourceTypeMapper extends BaseMapper<ApiSyncingDatasourceType> {
}
...@@ -58,12 +58,8 @@ public class ProducerServiceImpl implements ProducerService { ...@@ -58,12 +58,8 @@ public class ProducerServiceImpl implements ProducerService {
@Resource @Resource
private ApiInterfaceMapper apiInterfaceMapper; private ApiInterfaceMapper apiInterfaceMapper;
@Resource @Resource
private ApiSyncingDatasourceMapper apiSyncingDatasourceMapper;
@Resource
private ApiOpenApiEsFieldsMapper apiOpenApiEsFieldsMapper; private ApiOpenApiEsFieldsMapper apiOpenApiEsFieldsMapper;
@Resource @Resource
private ApiOpenApiEsTagconfigMapper apiOpenApiEsTagconfigMapper;
@Resource
private ApiInterfaceCustomMapper apiInterfaceCustomMapper; private ApiInterfaceCustomMapper apiInterfaceCustomMapper;
@Resource @Resource
private ApiInterfaceFileMapper apiInterfaceFileMapper; private ApiInterfaceFileMapper apiInterfaceFileMapper;
......
...@@ -25,18 +25,18 @@ spring: ...@@ -25,18 +25,18 @@ spring:
transport: transport:
# sentinel-dashboard服务地址 # sentinel-dashboard-1.6.0 的访问路径 , # sentinel-dashboard服务地址 # sentinel-dashboard-1.6.0 的访问路径 ,
#启动方式java -jar sentinel-dashboard-1.6.0.jar --server.port=9090 #启动方式java -jar sentinel-dashboard-1.6.0.jar --server.port=9090
dashboard: localhost:8080 dashboard: 127.0.0.1:8080
heartbeat-interval-ms: 500 heartbeat-interval-ms: 500
# 项目本地会启动一个服务的端口号,默认8719,用于与sentinel-dashboard通讯 # 项目本地会启动一个服务的端口号,默认8719,用于与sentinel-dashboard通讯
port: 8719 port: 8719
#服务器ip #服务器ip
clientIp: 192.168.1.114 # clientIp: 192.168.1.114
filter: # filter:
# 需要进行限流监控的接口,多个匹配用逗号隔开 # 需要进行限流监控的接口,多个匹配用逗号隔开
url-patterns: /* # url-patterns: /*
servlet: # servlet:
# 触发限流后重定向的页面 # 触发限流后重定向的页面
block-page: /sentinel/block # block-page: /sentinel/block
#取消Sentinel控制台懒加载 #取消Sentinel控制台懒加载
eager: true eager: true
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.jz.dm.mapper.ApiSyncingDatasourceMapper" >
<sql id="Base_Column_List">
id, datasource_type, datasource_name, datasource_desc, project_id,
jdbc_url, db_name, user_name, password, endpoint,
bucket, access_id, access_key, protocol, host,
port, default_fs, table_schema, data_status, remark,
create_date, create_user, update_date, update_user, is_deleted
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.jz.dm.mapper.ApiSyncingDatasourceTypeMapper" >
<sql id="Base_Column_List">
id, datasource, datasource_catecode, datasource_catename, datasource_type,
img_url, data_status, is_enabled, datasource_catetype, driver_class_name,
is_enable_test, default_source_script, default_target_script, is_enable_source, is_enable_target,
remark, create_date, create_user, update_date, update_user,
is_deleted
</sql>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment