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

如何在凡科上做网站wordpress源码最新

如何在凡科上做网站,wordpress源码最新,网站开发算固定资产,做网站赚钱 优帮云dubbo开启token服务后#xff0c;使用集群容错策略为FailoverClusterInvoker#xff0c;当出现服务调用失败进行转移#xff0c;重试其它服务器时#xff0c;会出现token invalid错误#xff0c;provider会拒绝服务调用。 原因#xff1a; 消费端#xff1a; 1、com.…dubbo开启token服务后使用集群容错策略为FailoverClusterInvoker当出现服务调用失败进行转移重试其它服务器时会出现token invalid错误provider会拒绝服务调用。 原因 消费端 1、com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker#doInvoke for (int i 0; i len; i) {//重试时进行重新选择避免重试时invoker列表已发生变化.//注意如果列表发生了变化那么invoked判断会失效因为invoker示例已经改变if (i 0) {checkWheatherDestoried();copyinvokers list(invocation);//重新检查一下checkInvokers(copyinvokers, invocation);}InvokerT invoker select(loadbalance, invocation, copyinvokers, invoked);invoked.add(invoker);RpcContext.getContext().setInvokers((List)invoked);try {if (le ! null logger.isWarnEnabled()) {logger.warn(Although retry the method invocation.getMethodName() in the service getInterface().getName() was successful by the provider invoker.getUrl().getAddress() , but there have been failed providers providers ( providers.size() / copyinvokers.size() ) from the registry directory.getUrl().getAddress() on the consumer NetUtils.getLocalHost() using the dubbo version Version.getVersion() . Last error is: le.getMessage(), le);}return result;} catch (RpcException e) {if (e.isBiz()) { // biz exception.throw e;}le e;} catch (Throwable e) {le new RpcException(e.getMessage(), e);} finally {providers.add(invoker.getUrl().getAddress());}2、com.alibaba.dubbo.rpc.protocol.AbstractInvoker#invoke RpcInvocation invocation (RpcInvocation) inv;invocation.setInvoker(this);if (attachment ! null attachment.size() 0) {invocation.addAttachmentsIfAbsent(attachment); //添加相关参数到附件attachments如token}MapString, String context RpcContext.getContext().getAttachments();if (context ! null) {invocation.addAttachmentsIfAbsent(context);}3、addAttachmentsIfAbsent实现 public void setAttachmentIfAbsent(String key, String value) {if (attachments null) {attachments new HashMapString, String();}if (! attachments.containsKey(key)) { //key不存在时才进行赋值因此不能进行覆盖操作attachments.put(key, value);}}服务提供方 public class TokenFilter implements Filter {public Result invoke(Invoker? invoker, Invocation inv)throws RpcException {String token invoker.getUrl().getParameter(Constants.TOKEN_KEY);if (ConfigUtils.isNotEmpty(token)) {Class? serviceType invoker.getInterface();MapString, String attachments inv.getAttachments();//解析attachments String remoteToken attachments null ? null : attachments.get(Constants.TOKEN_KEY);if (! token.equals(remoteToken)) {throw new RpcException(Invalid token! Forbid invoke remote service serviceType method inv.getMethodName() () from consumer RpcContext.getContext().getRemoteHost() to provider RpcContext.getContext().getLocalHost());}}return invoker.invoke(inv);}}通过上面的代码分析可知当消费者调用服务方服务出现超时进行失败重连时要重连的Invoker的token没有覆盖上一次的invoker的token而服务端比较token时比较的是attachment 进而出现token invalid错误。相当于失败重连无效. 错误现象 1、请求超时此时token是一致的 telnetinvoke,status,replacetokentimeout1000timestamp1418813410249token020f16e2-e060-4c85-a31a-017aa0ee268cversion1.0, cause: Waiting server-side response timeout. start time: 2014-12-17 21:42:26.735, end time: 2014-12-17 21:42:27.736, client elapsed: 0 ms, server elapsed: 1001 ms, timeout: 1000 ms, request: Request [id27484, version2.0.0, twowaytrue, eventfalse, brokenfalse, dataRpcInvocation […], attachments{token020f16e2-e060-4c85-a31a-017aa0ee268c, 。。。。。。。 2、失败重连此时附件token与url的不一致 …pid29465revision1.0.1sideconsumerstatusspring,loadtelnetinvoke,status,replacetokentimeout1000timestamp1418813410249 token0f3103ad-ac7b-4906-897c-b51e69ab3b96version1.0 - RpcInvocation […], attachments{token020f16e2-e060-4c85-a31a-017aa0ee268c, 。。。。。。。 3、出现token invalid com.alibaba.dubbo.rpc.RpcException: Invalid token! Forbid invoke remote service interface 可以将token设置为false解决
http://www.zqtcl.cn/news/470714/

相关文章:

  • 网站难做吗承德平台
  • 手机备案网站营销网络建设怎么写
  • 建个网站要花多少钱WordPress密码重设怎么改
  • 招商网站建设免费网站改版 升级的目的
  • 安徽圣力建设集团网站如何自己开发微信小程序
  • 学院网站板块盘多多搜索引擎入口
  • 网站seo内部优化wordpress建站网站报错
  • 网站建设科技国外网站入口
  • 怎样用网站做淘宝推广免费的项目管理软件
  • 共青城网站建设微网站开发报价
  • 网站建设选超速云建站网站建设公司比较
  • 芜湖网络科技有限公司沈阳网站推广优化公司哪家好
  • 自己制作图片文字图片网站建设和优化内容最重要性
  • 邢台做网站优化建筑行业新闻资讯
  • 站长统计app最新版本2023网站标题是关键词吗
  • 中山精品网站建设市场wordpress登陆phpadmin
  • 泸县手机网站建设佛山城市建设工程有限公司
  • 长沙网站推广排名优化wordpress主题字体更改
  • 深圳网站建设软件定制公司房地产开发公司注册资金要求
  • 个人如何在企业网站做实名认证房地产平面设计主要做什么
  • 网站做字工具WordPress搜索功能增强
  • 慢慢来做网站多少钱wordpress优化搜索引擎
  • 网页 网站 区别现在装宽带要多少钱
  • 黄金网站下载免费建设个人网站需要什么条件
  • 网站开发人员岗位职责网站维护报价单
  • 免费正能量不良网站推荐自建网站视频教程
  • 厦门物流网站建设南京宜电的网站谁做的
  • vps 网站备案手机界面设计素材
  • seo排名影响因素主要有灯塔seo
  • 济南哪家做网站小勇cms网站管理系统