当前位置: 首页 > news >正文

商城网站设计说明书微信网站建设费记什么科目

商城网站设计说明书,微信网站建设费记什么科目,成立网站要什么手续,网站建设要代码有什么好处官方参考文档#xff1a; 动态规则扩展 alibaba/Sentinel Wiki GitHub 需要修改的代码如下#xff1a; 为了便于后续版本集成nacos#xff0c;简单讲一下集成思路 1.更改pom 修改sentinel-datasource-nacos的范围 将 dependencygroupIdcom.alibaba.c…官方参考文档 动态规则扩展 · alibaba/Sentinel Wiki · GitHub 需要修改的代码如下 为了便于后续版本集成nacos简单讲一下集成思路 1.更改pom 修改sentinel-datasource-nacos的范围 将 dependencygroupIdcom.alibaba.csp/groupIdartifactIdsentinel-datasource-nacos/artifactIdscopetest/scope /dependency 改为 dependencygroupIdcom.alibaba.csp/groupIdartifactIdsentinel-datasource-nacos/artifactId!--scopetest/scope-- /dependency 2.拷贝示例 将test目录下的com.alibaba.csp.sentinel.dashboard.rule.nacos包下的内容拷贝到src的 com.alibaba.csp.sentinel.dashboard.rule的目录 test目录只包含限流其他规则参照创建即可。 创建时注意修改常量并且在NacosConfig实现各种converter 注意授权规则和热点规则需要特殊处理否则nacos配置不生效。 因为授权规则Entity比流控规则Entity多包了一层。 public class FlowRuleEntity implements RuleEntity public class AuthorityRuleEntity extends AbstractRuleEntityAuthorityRule 以授权规则为例 AuthorityRuleNacosProvider.java /** Copyright 1999-2018 Alibaba Group Holding Ltd.** Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.nacos.authority;import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.AuthorityRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; import com.alibaba.csp.sentinel.dashboard.rule.nacos.NacosConfigUtil; import com.alibaba.csp.sentinel.datasource.Converter; import com.alibaba.csp.sentinel.slots.block.authority.AuthorityRule; import com.alibaba.csp.sentinel.util.StringUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alibaba.nacos.api.config.ConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;import java.util.ArrayList; import java.util.List;/*** author Eric Zhao* since 1.4.0*/ Component(authorityRuleNacosProvider) public class AuthorityRuleNacosProvider implements DynamicRuleProviderListAuthorityRuleEntity {Autowiredprivate ConfigService configService;Autowiredprivate ConverterString, ListAuthorityRuleEntity converter;Overridepublic ListAuthorityRuleEntity getRules(String appName) throws Exception {String rules configService.getConfig(appName NacosConfigUtil.AUTHORITY_DATA_ID_POSTFIX,NacosConfigUtil.GROUP_ID, 3000);if (StringUtil.isEmpty(rules)) {return new ArrayList();}return converter.convert(this.parseRules(rules));}private String parseRules(String rules) {JSONArray newRuleJsons new JSONArray();JSONArray ruleJsons JSONArray.parseArray(rules);for (int i 0; i ruleJsons.size(); i) {JSONObject ruleJson ruleJsons.getJSONObject(i);AuthorityRuleEntity ruleEntity JSON.parseObject(ruleJson.toJSONString(), AuthorityRuleEntity.class);JSONObject newRuleJson JSON.parseObject(JSON.toJSONString(ruleEntity));AuthorityRule rule JSON.parseObject(ruleJson.toJSONString(), AuthorityRule.class);newRuleJson.put(rule, rule);newRuleJsons.add(newRuleJson);}return newRuleJsons.toJSONString();} } AuthorityRuleNacosPublisher.java /** Copyright 1999-2018 Alibaba Group Holding Ltd.** Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.nacos.authority;import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.AuthorityRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; import com.alibaba.csp.sentinel.dashboard.rule.nacos.NacosConfigUtil; import com.alibaba.csp.sentinel.datasource.Converter; import com.alibaba.csp.sentinel.util.AssertUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alibaba.nacos.api.config.ConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;import java.util.List;/*** author Eric Zhao* since 1.4.0*/ Component(authorityRuleNacosPublisher) public class AuthorityRuleNacosPublisher implements DynamicRulePublisherListAuthorityRuleEntity {Autowiredprivate ConfigService configService;Autowiredprivate ConverterListAuthorityRuleEntity, String converter;Overridepublic void publish(String app, ListAuthorityRuleEntity rules) throws Exception {AssertUtil.notEmpty(app, app name cannot be empty);if (rules null) {return;}configService.publishConfig(app NacosConfigUtil.AUTHORITY_DATA_ID_POSTFIX,NacosConfigUtil.GROUP_ID, this.parseRules(converter.convert(rules)));}private String parseRules(String rules) {JSONArray oldRuleJsons JSONArray.parseArray(rules);for (int i 0; i oldRuleJsons.size(); i) {JSONObject oldRuleJson oldRuleJsons.getJSONObject(i);JSONObject ruleJson oldRuleJson.getJSONObject(rule);oldRuleJson.putAll(ruleJson);oldRuleJson.remove(rule);}return oldRuleJsons.toJSONString();} } 热点规则同理 3.修改controller v2目录的FlowControllerV2 将 AutowiredQualifier(flowRuleDefaultProvider)private DynamicRuleProviderListFlowRuleEntity ruleProvider;AutowiredQualifier(flowRuleDefaultPublisher)private DynamicRulePublisherListFlowRuleEntity rulePublisher; 改为 AutowiredQualifier(flowRuleNacosProvider)private DynamicRuleProviderListFlowRuleEntity ruleProvider;AutowiredQualifier(flowRuleNacosPublisher)private DynamicRulePublisherListFlowRuleEntity rulePublisher; controller目录的其他controller包括 AuthorityRuleController DegradeController FlowControllerV1 ParamFlowRuleController SystemController 做如下更改(以DegradeController为例) 将 Autowiredprivate SentinelApiClient sentinelApiClient; 改成 AutowiredQualifier(degradeRuleNacosProvider)private DynamicRuleProviderListDegradeRuleEntity ruleProvider;AutowiredQualifier(degradeRuleNacosPublisher)private DynamicRulePublisherListDegradeRuleEntity rulePublisher; 将原有publishRules方法删除统一改成 private void publishRules(/*NonNull*/ String app) throws Exception {ListDegradeRuleEntity rules repository.findAllByApp(app);rulePublisher.publish(app, rules);} 之后解决报错的地方即可。 获取所有rules的地方 将 ListDegradeRuleEntity rules sentinelApiClient.fetchDegradeRuleOfMachine(app, ip, port); 改成 ListDegradeRuleEntity rules ruleProvider.getRules(app); 原有调用publishRules方法的地方删除掉 在上一个try catch方法里加上 publishRules(entity.getApp()); 这里的entity.getApp()也有可能是oldEntity.getApp()/app等变量。根据删除的publishRules代码片段推测即可。 4.修改前端文件 文件路径:src/main/webapp/resources/app/scripts/directives/sidebar/sidebar.html 将 a ui-srefdashboard.flowV1({app: entry.app}) 改成 a ui-srefdashboard.flow({app: entry.app}) 5.最后打包即可 执行命令打包成jar mvn clean package 运行方法与官方jar一致不做赘述 6.微服务程序集成 pom.xml添加 dependencygroupIdcom.alibaba.csp/groupIdartifactIdsentinel-datasource-nacos/artifactId/dependency 配置文件application.yml添加 spring:cloud:sentinel:datasource:# 名称随意flow:nacos:server-addr: localhost:8848dataId: ${spring.application.name}-flow-rulesgroupId: SENTINEL_GROUP# 规则类型取值见# org.springframework.cloud.alibaba.sentinel.datasource.RuleTyperule-type: flowdegrade:nacos:server-addr: localhost:8848dataId: ${spring.application.name}-degrade-rulesgroupId: SENTINEL_GROUPrule-type: degradesystem:nacos:server-addr: localhost:8848dataId: ${spring.application.name}-system-rulesgroupId: SENTINEL_GROUPrule-type: systemauthority:nacos:server-addr: localhost:8848dataId: ${spring.application.name}-authority-rulesgroupId: SENTINEL_GROUPrule-type: authorityparam-flow:nacos:server-addr: localhost:8848dataId: ${spring.application.name}-param-flow-rulesgroupId: SENTINEL_GROUPrule-type: param-flow 7.测试验证 在sentinel控制台界面添加几个流控规则后尝试关闭微服务和sentinel然后重新打开sentinel和微服务看流控规则是否还在。 8.最后把配置好的代码发给大家大家可以自行下载里边有运行访问流程 https://download.csdn.net/download/qq_34091529/88482757
http://www.dnsts.com.cn/news/139638.html

相关文章:

  • 国外网站建设企业百度站长工具app
  • asp.net的网站开发网站设计毕业设计
  • vs2015 手机网站开发企业网站代码怎么优化
  • 个人网站做装修可以吗我的世界做皮肤壁纸网站
  • 西宁网站运营公司东台做网站找哪家好
  • 自适应网站用什么软件设计中企动力企业邮箱官网
  • 网站ps照片怎么做的网站制作一般收费
  • 织梦网站修改幻灯片上海装修找哪家公司好
  • 网站备案后 换服务器网站开发过程的需求分析
  • 做个一般的网站要多少钱企业网页制作推广
  • 可以用自己的电脑做网站吗网络科技工作室起名
  • 珠海网站建设推广方案西安seo网站建设
  • 上海网站建设 网站开中国建设造价协会网站
  • 春节网页设计素材网站企查查企业在线查询
  • 上街三屏网站建设企业网站推广技术
  • 厦门北京网站建设公司浏览器一打开就是2345网址导航
  • 衣服网站建设策划书做购物网站适合的服务器
  • 喜欢做木工 网站网上做分销代销哪个网站好
  • 龙川县建设网站建筑网站排行
  • 东营市报名系统网站设计公司软件开发文档管理规范
  • 计算机编程是做网站杭州微网站开发公司
  • 汕头网站关键词推广网站建设新手教程视频教程
  • 资溪做面包招聘的网站生物科技公司网站模板下载
  • 做网站 信科网络西宁网站建设开发
  • 做网站 需求wordpress文章列表排序
  • 网站的主要功能网站开发语言占有率
  • 建设网站的企业西安展厅设计公司
  • 网站建设技能描述加速游戏流畅的软件
  • 门户网站建设的背景和意义上海百度竞价托管
  • 做网站全过程折800网站源码