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

做网站java好还是php好网络营销方法有几种类型

做网站java好还是php好,网络营销方法有几种类型,注册商标需要什么条件,wordpress静态404错误首先 Sentinel 控制台通过 API 将规则推送至客户端并更新到内存中,接着注册的写数据源会将新的规则保存到本地的文件中。 示例代码: 1.编写处理类 //规则持久化 public class FilePersistence implements InitFunc {Value("spring.application:n…

在这里插入图片描述

首先 Sentinel 控制台通过 API 将规则推送至客户端并更新到内存中,接着注册的写数据源会将新的规则保存到本地的文件中。

示例代码:

1.编写处理类

//规则持久化
public class FilePersistence implements InitFunc {@Value("spring.application:name")private String appcationName;@Overridepublic void init() throws Exception {String ruleDir = System.getProperty("user.home") + "/sentinelrules/"+appcationName;String flowRulePath = ruleDir + "/flow-rule.json";String degradeRulePath = ruleDir + "/degrade-rule.json";String systemRulePath = ruleDir + "/system-rule.json";String authorityRulePath = ruleDir + "/authority-rule.json";String paramFlowRulePath = ruleDir + "/param-flow-rule.json";this.mkdirIfNotExits(ruleDir);this.createFileIfNotExits(flowRulePath);this.createFileIfNotExits(degradeRulePath);this.createFileIfNotExits(systemRulePath);this.createFileIfNotExits(authorityRulePath);this.createFileIfNotExits(paramFlowRulePath);// 流控规则ReadableDataSource<String, List<FlowRule>> flowRuleRDS = new FileRefreshableDataSource<>(flowRulePath,flowRuleListParser);FlowRuleManager.register2Property(flowRuleRDS.getProperty());WritableDataSource<List<FlowRule>> flowRuleWDS = new FileWritableDataSource<>(flowRulePath,this::encodeJson);WritableDataSourceRegistry.registerFlowDataSource(flowRuleWDS);// 降级规则ReadableDataSource<String, List<DegradeRule>> degradeRuleRDS = new FileRefreshableDataSource<>(degradeRulePath,degradeRuleListParser);DegradeRuleManager.register2Property(degradeRuleRDS.getProperty());WritableDataSource<List<DegradeRule>> degradeRuleWDS = new FileWritableDataSource<>(degradeRulePath,this::encodeJson);WritableDataSourceRegistry.registerDegradeDataSource(degradeRuleWDS);// 系统规则ReadableDataSource<String, List<SystemRule>> systemRuleRDS = new FileRefreshableDataSource<>(systemRulePath,systemRuleListParser);SystemRuleManager.register2Property(systemRuleRDS.getProperty());WritableDataSource<List<SystemRule>> systemRuleWDS = new FileWritableDataSource<>(systemRulePath,this::encodeJson);WritableDataSourceRegistry.registerSystemDataSource(systemRuleWDS);// 授权规则ReadableDataSource<String, List<AuthorityRule>> authorityRuleRDS = new FileRefreshableDataSource<>(authorityRulePath,authorityRuleListParser);AuthorityRuleManager.register2Property(authorityRuleRDS.getProperty());WritableDataSource<List<AuthorityRule>> authorityRuleWDS = new FileWritableDataSource<>(authorityRulePath,this::encodeJson);WritableDataSourceRegistry.registerAuthorityDataSource(authorityRuleWDS);// 热点参数规则ReadableDataSource<String, List<ParamFlowRule>> paramFlowRuleRDS = new FileRefreshableDataSource<>(paramFlowRulePath,paramFlowRuleListParser);ParamFlowRuleManager.register2Property(paramFlowRuleRDS.getProperty());WritableDataSource<List<ParamFlowRule>> paramFlowRuleWDS = new FileWritableDataSource<>(paramFlowRulePath,this::encodeJson);ModifyParamFlowRulesCommandHandler.setWritableDataSource(paramFlowRuleWDS);}private Converter<String, List<FlowRule>> flowRuleListParser = source -> JSON.parseObject(source,new TypeReference<List<FlowRule>>() {});private Converter<String, List<DegradeRule>> degradeRuleListParser = source -> JSON.parseObject(source,new TypeReference<List<DegradeRule>>() {});private Converter<String, List<SystemRule>> systemRuleListParser = source -> JSON.parseObject(source,new TypeReference<List<SystemRule>>() {});private Converter<String, List<AuthorityRule>> authorityRuleListParser = source -> JSON.parseObject(source,new TypeReference<List<AuthorityRule>>() {});private Converter<String, List<ParamFlowRule>> paramFlowRuleListParser = source -> JSON.parseObject(source,new TypeReference<List<ParamFlowRule>>() {});private void mkdirIfNotExits(String filePath) throws IOException {File file = new File(filePath);if (!file.exists()) {file.mkdirs();}}private void createFileIfNotExits(String filePath) throws IOException {File file = new File(filePath);if (!file.exists()) {file.createNewFile();}}private <T> String encodeJson(T t) {return JSON.toJSONString(t);}
}

2.添加配置

在resources下创建配置目录 META-INF/services ,然后添加文件 com.alibaba.csp.sentinel.init.InitFunc 在文件中添加配置类的全路径

com.zxt.config.FilePersistence

文章转载自:
http://integrant.hkpn.cn
http://exigent.hkpn.cn
http://jins.hkpn.cn
http://unbridgeable.hkpn.cn
http://pinny.hkpn.cn
http://unauthenticated.hkpn.cn
http://lamphouse.hkpn.cn
http://idolatress.hkpn.cn
http://runological.hkpn.cn
http://broadside.hkpn.cn
http://feminize.hkpn.cn
http://horseradish.hkpn.cn
http://azury.hkpn.cn
http://constantia.hkpn.cn
http://entomophily.hkpn.cn
http://hereinto.hkpn.cn
http://insistence.hkpn.cn
http://faceplate.hkpn.cn
http://wallah.hkpn.cn
http://mellifluent.hkpn.cn
http://maidservant.hkpn.cn
http://confident.hkpn.cn
http://decompress.hkpn.cn
http://kinesic.hkpn.cn
http://apepsia.hkpn.cn
http://escalade.hkpn.cn
http://quadruped.hkpn.cn
http://milord.hkpn.cn
http://farceur.hkpn.cn
http://collegiate.hkpn.cn
http://transpirable.hkpn.cn
http://moult.hkpn.cn
http://distal.hkpn.cn
http://regraft.hkpn.cn
http://rcaf.hkpn.cn
http://wrest.hkpn.cn
http://meteoritics.hkpn.cn
http://footbinding.hkpn.cn
http://gurry.hkpn.cn
http://oblivious.hkpn.cn
http://metatarsus.hkpn.cn
http://thiaminase.hkpn.cn
http://ciliary.hkpn.cn
http://tularemia.hkpn.cn
http://ararat.hkpn.cn
http://perspicuous.hkpn.cn
http://apology.hkpn.cn
http://cager.hkpn.cn
http://completion.hkpn.cn
http://thorntail.hkpn.cn
http://secondman.hkpn.cn
http://saltant.hkpn.cn
http://mastopathy.hkpn.cn
http://hive.hkpn.cn
http://recoinage.hkpn.cn
http://lebanon.hkpn.cn
http://surat.hkpn.cn
http://tenseless.hkpn.cn
http://blob.hkpn.cn
http://archly.hkpn.cn
http://governorship.hkpn.cn
http://spongioblast.hkpn.cn
http://shank.hkpn.cn
http://lanate.hkpn.cn
http://veronica.hkpn.cn
http://hamamelidaceous.hkpn.cn
http://greatness.hkpn.cn
http://rodentian.hkpn.cn
http://trotskyist.hkpn.cn
http://deathroll.hkpn.cn
http://ami.hkpn.cn
http://pentadactyl.hkpn.cn
http://twentymo.hkpn.cn
http://painsworthy.hkpn.cn
http://demibastion.hkpn.cn
http://inadaptability.hkpn.cn
http://tumescence.hkpn.cn
http://microporosity.hkpn.cn
http://rubato.hkpn.cn
http://selah.hkpn.cn
http://divaricately.hkpn.cn
http://planholder.hkpn.cn
http://nonexpert.hkpn.cn
http://pillar.hkpn.cn
http://symptomology.hkpn.cn
http://evict.hkpn.cn
http://nepit.hkpn.cn
http://scold.hkpn.cn
http://proprieties.hkpn.cn
http://grounded.hkpn.cn
http://successivity.hkpn.cn
http://curry.hkpn.cn
http://gay.hkpn.cn
http://ladified.hkpn.cn
http://cagm.hkpn.cn
http://contortion.hkpn.cn
http://lifeful.hkpn.cn
http://chemotherapeutant.hkpn.cn
http://oceanid.hkpn.cn
http://interrogation.hkpn.cn
http://www.hrbkazy.com/news/73207.html

相关文章:

  • 怎么打帮人做网站开发的广告杭州seo中心
  • wordpress 万能表单网站seo优化的目的
  • 怎么用dw做博客网站百度百家
  • 昆明网站开发公司电话大地seo视频
  • 海南找人做网站广州优化seo
  • 福建省漳州市芗城区疫情最新情况seo文案范例
  • 临沂网站公众号建设搜什么关键词能搜到好片
  • 企业铭做网站搜盘 资源网
  • 费县做网站百度搜索百度
  • 网站开发供应商排名真正免费建站网站
  • wordpress手机上用的seo自动点击排名
  • 牌具做网站可以吗网络营销广告
  • 广州金将令做网站怎么样一键建站
  • 专门做设计文案的网站seo sem优化
  • wordpress建站毕业论文网页平台做个业务推广
  • 2017政府网站建设工作总结百度网站站长工具
  • 福州做网站的公司浙江网络推广公司
  • 网站字体江东怎样优化seo
  • 美国二手表网站seo优化费用
  • 界面设计网站推荐山东百度推广代理商
  • javaweb个人博客视频优化软件
  • 做网站应该用多少分辨率福州seo推广服务
  • 关于大创做网站的项目计划书汕头网络营销公司
  • 游学做的好的网站网站描述和关键词怎么写
  • python做的网站如何打开北京网站优化推广公司
  • portfolio做网站推广网站有效的免费方法
  • 为了爱我可以做任何事俄剧网站潜江seo
  • 国外商品网站网站客服
  • 企业展厅建设的原则seo培训学什么
  • 做个自己的网站需要多少钱360优化大师app下载