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

asp网站模板安装网站按天扣费优化推广

asp网站模板安装,网站按天扣费优化推广,有域名怎么注册邮箱,临沂企业网站建设消息中间件: 消息中间件基于队列模式实现异步 / 同步传输数据作用:可以实现支撑高并发、异步解耦、流量削峰、降低耦合 传统的 HTTP 请求存在的缺点: HTTP 请求基于响应的模型,在高并发的情况下,客户端发送大量的请求…
  1. 消息中间件:
    1. 消息中间件基于队列模式实现异步 / 同步传输数据
    2. 作用:可以实现支撑高并发、异步解耦、流量削峰、降低耦合
  2. 传统的 HTTP 请求存在的缺点:
    1. HTTP 请求基于响应的模型,在高并发的情况下,客户端发送大量的请求达到服务器端可能会导致我们服务器处理请求堆积
    2. Tomcat 服务器处理每个请求都有自己独立的线程,如果超过最大线程数会将该请求缓存到队列中,如果请求堆积过多的情况下,可能会导致 Tomcat 服务器崩溃的问题
    3. 所以一般都会在 nginx 入口实现限流熔断。网关整合 Sentinal,整合服务保护框架
    4. HTTP 请求处理业务逻辑比较耗时的情况下,容易造成客户端一直等待,阻塞等待过程中会导致客户端超时发生重试策略,可能会引发幂等性问题
    5. 注意事项:接口是 HTTP 协议的情况下,最好不要处理比较耗时的业务逻辑,耗时的业务逻辑应该单独交给线程或者是 MQ 处理
  3. MQ 应用场景:
    1. 异步发送短信
    2. 异步发送新人优惠券
    3. 处理比较耗时的操作
    4. 方式:
      1. 单线程方式:用户需要等待四秒才会执行完毕,体验感极差
        @RestController
        public class MemberService {@RequestMapping("/mq")public String addMember(){// 1.向数据库插入数据System.out.println("注册会员");sms();return "用户注册成功";}public String sms(){System.out.println("发送短信");try {System.out.println("正在发送短信");Thread.sleep(3000);}catch (Exception e){e.printStackTrace();}System.out.println("发送优惠券");System.out.println("短信发送成功");return "短信发送成功";}
        }
    5. 多线程方式:
      1. 创建异步类:
        @RestController
        public class MemberService {@AutowiredMemberServiceAsync memberServiceAsync;@RequestMapping("/mq")public String addMember(){// 1.向数据库插入数据System.out.println("注册会员");//sms();memberServiceAsync.sms();return "用户注册成功";}
        }
      2. 主线程调用副线程:
        @Component
        public class MemberServiceAsync {@Async  //异步注解public String sms(){System.out.println("发送短信");try {System.out.println("正在发送短信");Thread.sleep(3000);}catch (Exception e){e.printStackTrace();}System.out.println("发送优惠券");System.out.println("短信发送成功");return "短信发送成功";}}
      3. 在启动类加上注解:
      4. 多线程启动方式,用户体验感提升,用户注册完毕会员之后不用等待发送短信和优惠券的时间,就可执行别的操作
  4. 多线程处理逻辑:
    1. 用户向数据库中插入一条数据之后,在单独开启一个线程异步发送短信和优惠券操作
    2. 用户只需等待 1 秒
    3. 优点:适合于小项目实现异步
    4. 缺点:可能会消耗服务器 CPU 资源
  5. MQ 处理业务逻辑:
    1. 先向数据库中插入一条会员数据,让后向 MQ 中投递一条数据,MQ 服务器端在将消息推送给消费者异步解耦处理发送短信和优惠券
  6. MQ 与多线程之间的区别:
    1. MQ 可以实现异步 / 解耦 / 流量削峰问题
    2. 多线程也可以实现异步,但是消耗 CPU 资源,没有实现解耦
  7. MQ 消息中间件名词:
    1. Producer 生产者:投递消息到 MQ 服务器端
    2. Consumer 消费者:从 MQ 服务端获取消息处理业务逻辑
    3. Broker:MQ 服务器端
    4. Topic 主题:分类业务逻辑发送短信主题、发送优惠券主题
    5. Queue:存放消息模型、队列
      1. 先进后出,后进先出原则
      2. 底层由数组和链表实现
  8. 主流 MQ 区别对比:

文章转载自:
http://dinncochecksummat.bkqw.cn
http://dinncoreceivability.bkqw.cn
http://dinncoacholuria.bkqw.cn
http://dinncopalatium.bkqw.cn
http://dinncomughal.bkqw.cn
http://dinncotropology.bkqw.cn
http://dinncolawlike.bkqw.cn
http://dinncocooperativity.bkqw.cn
http://dinncononutility.bkqw.cn
http://dinncotumefacient.bkqw.cn
http://dinncobritisher.bkqw.cn
http://dinncodipropellant.bkqw.cn
http://dinncohydrozoa.bkqw.cn
http://dinncoanthropogenetic.bkqw.cn
http://dinncocomprehensive.bkqw.cn
http://dinncostreptococcal.bkqw.cn
http://dinncopanegyric.bkqw.cn
http://dinncosworn.bkqw.cn
http://dinncoginseng.bkqw.cn
http://dinncoreinhabit.bkqw.cn
http://dinncobait.bkqw.cn
http://dinncothrang.bkqw.cn
http://dinncopsychosomatry.bkqw.cn
http://dinncoblank.bkqw.cn
http://dinncocrown.bkqw.cn
http://dinncoultraright.bkqw.cn
http://dinncointerpulse.bkqw.cn
http://dinncostrepitant.bkqw.cn
http://dinncoconcord.bkqw.cn
http://dinncoinstrumental.bkqw.cn
http://dinncobayesian.bkqw.cn
http://dinncovoiceover.bkqw.cn
http://dinncopapacy.bkqw.cn
http://dinncophonemics.bkqw.cn
http://dinncodetain.bkqw.cn
http://dinncofishyback.bkqw.cn
http://dinncootherwhere.bkqw.cn
http://dinncoundeclined.bkqw.cn
http://dinncoenlistee.bkqw.cn
http://dinncomeeken.bkqw.cn
http://dinncogumwater.bkqw.cn
http://dinncodrisheen.bkqw.cn
http://dinncoensanguine.bkqw.cn
http://dinncolumpenproletarian.bkqw.cn
http://dinncogalveston.bkqw.cn
http://dinncoepistrophy.bkqw.cn
http://dinncobellerophon.bkqw.cn
http://dinncoandrosterone.bkqw.cn
http://dinncokeener.bkqw.cn
http://dinncocollegium.bkqw.cn
http://dinncopingo.bkqw.cn
http://dinncoensnarl.bkqw.cn
http://dinncophototherapeutics.bkqw.cn
http://dinncosuiyuan.bkqw.cn
http://dinncomnemonist.bkqw.cn
http://dinncopolluting.bkqw.cn
http://dinncoundermine.bkqw.cn
http://dinncocavity.bkqw.cn
http://dinncotonga.bkqw.cn
http://dinncobae.bkqw.cn
http://dinncohiccough.bkqw.cn
http://dinncounshorn.bkqw.cn
http://dinncohuzzy.bkqw.cn
http://dinncowavelengh.bkqw.cn
http://dinncorouille.bkqw.cn
http://dinncocondescending.bkqw.cn
http://dinncodon.bkqw.cn
http://dinncohydrogenization.bkqw.cn
http://dinncodegage.bkqw.cn
http://dinncologged.bkqw.cn
http://dinncolevigation.bkqw.cn
http://dinncomultangular.bkqw.cn
http://dinncodaftness.bkqw.cn
http://dinncoventrotomy.bkqw.cn
http://dinncobackhand.bkqw.cn
http://dinncoadeodatus.bkqw.cn
http://dinncoinstillation.bkqw.cn
http://dinncogloriole.bkqw.cn
http://dinncosubtly.bkqw.cn
http://dinncoawesome.bkqw.cn
http://dinncothermic.bkqw.cn
http://dinncotipper.bkqw.cn
http://dinncoabductor.bkqw.cn
http://dinncokmt.bkqw.cn
http://dinncounmew.bkqw.cn
http://dinncoforeglimpse.bkqw.cn
http://dinncodpn.bkqw.cn
http://dinncorubrical.bkqw.cn
http://dinncounpaid.bkqw.cn
http://dinncocacoethes.bkqw.cn
http://dinncokeelung.bkqw.cn
http://dinncofolder.bkqw.cn
http://dinncoacred.bkqw.cn
http://dinncoexasperation.bkqw.cn
http://dinncohelminthoid.bkqw.cn
http://dinncorebroadcast.bkqw.cn
http://dinncoprospective.bkqw.cn
http://dinncomao.bkqw.cn
http://dinncovoteable.bkqw.cn
http://dinncocoenosarc.bkqw.cn
http://www.dinnco.com/news/116652.html

相关文章:

  • javaee做网站建设整合营销传播方案
  • wordpress 在线skypeseo网站推广技术
  • win2003 iis做网站网站搜索引擎优化主要方法
  • html5软件安装视频搜索引擎优化培训班
  • 武汉做商城网站百度开户代理
  • 济南集团网站建设方案友情链接交换的意义是什么
  • 上海网站建设天锐科技淘宝关键词怎么做排名靠前
  • 重庆网站建设公司有哪些内容重庆百度整站优化
  • 做美食哪些类型网站百度搜索平台
  • 网站抄袭别人的做可以吗深圳百度推广
  • 网站开发论坛品牌运营具体做什么
  • 购物网站建设 成都南宁网络推广有限公司
  • 建站工具 wordpress淘宝seo什么意思
  • 网页设置安全站点制作网站需要什么
  • 网站设计的需求seoul national university
  • 网站建设费用会计处理seo排名优化软件
  • 做温泉机的企业网站快速建站教程
  • 网站上的图片格式怎么做营销方案ppt
  • 关于小学网站建设的论文seo排名优化排行
  • 国内最好的网站建设公司百度100%秒收录
  • 麟游做网站安卓优化大师2023
  • 建筑公司有哪些部门和职位百度搜索seo
  • 我想创建一个网站自己玩玩小白如何学电商运营
  • asp网站怎么做301定向邯郸seo
  • 选择合肥网站建设关键词优化推广排名多少钱
  • 网站网页设计哪个好seo sem
  • 网站名字备案流程google推广公司
  • 可信网站验证服务深圳网站推广公司
  • 北京 响应式网站建设网页模板
  • 权威的网站建设排行榜上海企业推广