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

公司建设官方网站需要多少钱厦门网站制作方案

公司建设官方网站需要多少钱,厦门网站制作方案,企信网企业信用信息系统贵州,企业网站源码库为什么80%的码农都做不了架构师#xff1f; ##序 使用zuul作为api网关的话#xff0c;经常会碰见一些异常#xff0c;这里小结一下。 ##ZuulException 这个是最外层的异常 public class ZuulException extends Exception {public int nStatusCode;public Str… 为什么80%的码农都做不了架构师    ##序 使用zuul作为api网关的话经常会碰见一些异常这里小结一下。 ##ZuulException 这个是最外层的异常 public class ZuulException extends Exception {public int nStatusCode;public String errorCause;/*** Source Throwable, message, status code and info about the cause* param throwable* param sMessage* param nStatusCode* param errorCause*/public ZuulException(Throwable throwable, String sMessage, int nStatusCode, String errorCause) {super(sMessage, throwable);this.nStatusCode nStatusCode;this.errorCause errorCause;incrementCounter(ZUUL::EXCEPTION: errorCause : nStatusCode);}/*** error message, status code and info about the cause* param sMessage* param nStatusCode* param errorCause*/public ZuulException(String sMessage, int nStatusCode, String errorCause) {super(sMessage);this.nStatusCode nStatusCode;this.errorCause errorCause;incrementCounter(ZUUL::EXCEPTION: errorCause : nStatusCode);}/*** Source Throwable, status code and info about the cause* param throwable* param nStatusCode* param errorCause*/public ZuulException(Throwable throwable, int nStatusCode, String errorCause) {super(throwable.getMessage(), throwable);this.nStatusCode nStatusCode;this.errorCause errorCause;incrementCounter(ZUUL::EXCEPTION: errorCause : nStatusCode);}private static final void incrementCounter(String name) {CounterFactory.instance().increment(name);}}##RibbonRoutingFilter spring-cloud-netflix-core-1.2.6.RELEASE-sources.jar!/org/springframework/cloud/netflix/zuul/filters/route/RibbonRoutingFilter.java 这个类抛了很多ZuulException Overridepublic Object run() {RequestContext context RequestContext.getCurrentContext();this.helper.addIgnoredHeaders();try {RibbonCommandContext commandContext buildCommandContext(context);ClientHttpResponse response forward(commandContext);setResponse(response);return response;}catch (ZuulException ex) {context.set(ERROR_STATUS_CODE, ex.nStatusCode);context.set(error.message, ex.errorCause);context.set(error.exception, ex);}catch (Exception ex) {context.set(error.status_code,HttpServletResponse.SC_INTERNAL_SERVER_ERROR);context.set(error.exception, ex);}return null;}###forward protected ClientHttpResponse forward(RibbonCommandContext context) throws Exception {MapString, Object info this.helper.debug(context.getMethod(),context.getUri(), context.getHeaders(), context.getParams(),context.getRequestEntity());RibbonCommand command this.ribbonCommandFactory.create(context);try {ClientHttpResponse response command.execute();this.helper.appendDebug(info, response.getStatusCode().value(),response.getHeaders());return response;}catch (HystrixRuntimeException ex) {return handleException(info, ex);}}这里有一个HystrixRuntimeException主要是跟hystrix相关的比如超时等。 ###handleException protected ClientHttpResponse handleException(MapString, Object info,HystrixRuntimeException ex) throws ZuulException {int statusCode HttpStatus.INTERNAL_SERVER_ERROR.value();Throwable cause ex;String message ex.getFailureType().toString();ClientException clientException findClientException(ex);if (clientException null) {clientException findClientException(ex.getFallbackException());}if (clientException ! null) {if (clientException.getErrorType() ClientException.ErrorType.SERVER_THROTTLED) {statusCode HttpStatus.SERVICE_UNAVAILABLE.value();}cause clientException;message clientException.getErrorType().toString();}info.put(status, String.valueOf(statusCode));throw new ZuulException(cause, Forwarding error, statusCode, message);}###findClientException protected ClientException findClientException(Throwable t) {if (t null) {return null;}if (t instanceof ClientException) {return (ClientException) t;}return findClientException(t.getCause());}com.netflix.client.ClientException public class ClientException extends Exception{/*** */private static final long serialVersionUID -7697654244064441234L;/*** define your error codes here* */public enum ErrorType{GENERAL, CONFIGURATION, NUMBEROF_RETRIES_EXEEDED, NUMBEROF_RETRIES_NEXTSERVER_EXCEEDED, SOCKET_TIMEOUT_EXCEPTION, READ_TIMEOUT_EXCEPTION,UNKNOWN_HOST_EXCEPTION,CONNECT_EXCEPTION,CLIENT_THROTTLED,SERVER_THROTTLED,NO_ROUTE_TO_HOST_EXCEPTION,CACHE_MISSING;static String getName(int errorCode){if (ErrorType.values().length errorCode){return ErrorType.values()[errorCode].name();}else{return UNKNOWN ERROR CODE;}}} //... }想获取最新资讯请关注微信公众号 转载于:https://my.oschina.net/go4it/blog/994069
http://www.zqtcl.cn/news/167220/

相关文章:

  • 购物网站项目建设内容有啥网站是专做时尚穿搭
  • 网上下载的网站模板怎么用wordpress 注册密码
  • 网站建设免费国外撤销网站备案申请书
  • 佛山做网站那家好网站建设公司如何盈利
  • 傻瓜建网站设计感网站
  • 北京网站优化软件陕西省建筑信息平台
  • 广州越秀建网站济南房产网新开楼盘
  • 线上咨询预约网站建设方案保定外贸网站制作
  • 网站流量如何增加提高工作效率的措施
  • 龙湖镇华南城网站建设.net 网站开发书籍
  • 域名费用和网站服务器费用是同样的吗推广营销方案
  • 安徽网站设计方案中文外贸网站有哪些
  • 衡阳手机网站设计响应式网站做多大的尺寸
  • 海尔电子商务网站建设预算灵台县门户网
  • 四川网站建设设计公司排名开发公司与建筑公司合作协议
  • 江西智能网站建设嘉定注册公司
  • 海口网站建设联系方式十大免费软文推广平台
  • 石碣镇做网站帮别人做网站开价
  • 站长 网站ip客户都不愿意做网站
  • 网站开发和软件开发哪个难网站备案账号
  • 2昌平区网站建设安徽盛绿建设网站
  • 商务网站建设目的天津建设网站需要的费用
  • flash 网站头部wordpress支持大文件上传
  • 网站开发方式的选择凡客设计
  • 常德建设网站如何查询某个网站的设计公司
  • wordpress 仿站教程学校ui设计培训
  • 南昌模板建站定制网站合肥瑶海区网站建设价格
  • 奥尔马手表官方网站导出wordpress文章
  • 网站栏目内容和功能手机网站建设 如何获得更好的排名
  • 网站运营推广难做常德网警