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

门户网站建设解决方案快手推广网站

门户网站建设解决方案,快手推广网站,网址生成,山西疫情最新情况今日新增在哪里1 消息可靠性 消息从发送,到消费者接收,会经理多个过程,其中的每一步都可能导致消息丢失. #### 2 常见的丢失原因 发送时丢失: 生产者发送的消息未送达exchange 消息到达exchange后未到达queueMQ宕机,queue将消息丢失 consumer…

1 消息可靠性

消息从发送,到消费者接收,会经理多个过程,其中的每一步都可能导致消息丢失.

在这里插入图片描述#### 2 常见的丢失原因

  • 发送时丢失:
    生产者发送的消息未送达exchange
    消息到达exchange后未到达queue
  • MQ宕机,queue将消息丢失
    consumer接收到消息后未消费就宕机
2.2 RabbitMQ分别给出了解决方案:
  • 生产者确认机制
  • mq持久化
  • 消费者确认机制
  • 失败重试机制

3 生产者消息确认

RabbitMQ提供了publisher confirm机制来避免消息发送到MQ过程中丢失。这种机制必须给每个消息指定一个唯一ID。消息发送到MQ以后,会返回一个结果给发送者,表示消息是否处理成功。

  • publisher-confirm-type 消息确认类型,
    • simple:同步等待confirm结果,直到超时
    • correlated:异步回调,定义ConfirmCallback,MQ返回结果时会回调这个ConfirmCallback
  • publisher-returns 交换机发送到队列中,失败时触发
  • template.mandatory:定义消息路由失败时的策略。true,则调用ReturnCallback;false:则直接丢弃消息
spring:rabbitmq:publisher-confirm-type: correlatedpublisher-returns: truetemplate:mandatory: true

然后配置 RabbitTemplate

@Slf4j
@Configuration
public class RabbitCommonConfig {@Beanpublic RabbitTemplate fastjsonRabbitTemplate(ConnectionFactory connectionFactory){RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);//设置强制回调rabbitTemplate.setMandatory(true);//rabbitTemplate.setConfirmCallback(new RabbitTemplate.ConfirmCallback() {@Overridepublic void confirm(CorrelationData correlationData, boolean b, String s) {log.info("对应数据 {}",correlationData);log.info("确认情况 {}",b);log.info("原因 {}",s);}});//发送失败时的回调rabbitTemplate.setReturnsCallback(new RabbitTemplate.ReturnsCallback() {@Overridepublic void returnedMessage(ReturnedMessage returnedMessage) {log.info("确认情况 {}",returnedMessage.toString());//日志记录 重试}});return rabbitTemplate;}}

完毕


文章转载自:
http://ismec.bnpn.cn
http://exoergic.bnpn.cn
http://huggery.bnpn.cn
http://praenomen.bnpn.cn
http://ruefully.bnpn.cn
http://nahua.bnpn.cn
http://radioprotective.bnpn.cn
http://bannerline.bnpn.cn
http://enrobe.bnpn.cn
http://hapless.bnpn.cn
http://carvel.bnpn.cn
http://curlycue.bnpn.cn
http://zenophobia.bnpn.cn
http://freak.bnpn.cn
http://paramedian.bnpn.cn
http://carbolize.bnpn.cn
http://tipstaves.bnpn.cn
http://botanist.bnpn.cn
http://clap.bnpn.cn
http://practicant.bnpn.cn
http://wardian.bnpn.cn
http://homologue.bnpn.cn
http://bibulous.bnpn.cn
http://riven.bnpn.cn
http://corroborator.bnpn.cn
http://albomycin.bnpn.cn
http://labialise.bnpn.cn
http://jokul.bnpn.cn
http://haloplankton.bnpn.cn
http://checkbox.bnpn.cn
http://fossick.bnpn.cn
http://cathetometer.bnpn.cn
http://radc.bnpn.cn
http://polymerise.bnpn.cn
http://forester.bnpn.cn
http://factice.bnpn.cn
http://cooperator.bnpn.cn
http://tasteless.bnpn.cn
http://longbowman.bnpn.cn
http://appanage.bnpn.cn
http://purp.bnpn.cn
http://hooklet.bnpn.cn
http://hepatitis.bnpn.cn
http://dockside.bnpn.cn
http://personalty.bnpn.cn
http://irrelievable.bnpn.cn
http://ballerina.bnpn.cn
http://rudesheimer.bnpn.cn
http://caprificator.bnpn.cn
http://thiobacteria.bnpn.cn
http://hardback.bnpn.cn
http://blighted.bnpn.cn
http://distractor.bnpn.cn
http://toxaphene.bnpn.cn
http://outstretch.bnpn.cn
http://adiantum.bnpn.cn
http://burnable.bnpn.cn
http://dexterous.bnpn.cn
http://phyllophagous.bnpn.cn
http://unipotent.bnpn.cn
http://mtbf.bnpn.cn
http://undiscerning.bnpn.cn
http://roar.bnpn.cn
http://wotteth.bnpn.cn
http://lms.bnpn.cn
http://redivide.bnpn.cn
http://pub.bnpn.cn
http://maglemosian.bnpn.cn
http://shoal.bnpn.cn
http://slosh.bnpn.cn
http://carpellate.bnpn.cn
http://ruga.bnpn.cn
http://mistflower.bnpn.cn
http://tatting.bnpn.cn
http://latecomer.bnpn.cn
http://deflocculation.bnpn.cn
http://carmot.bnpn.cn
http://polymasty.bnpn.cn
http://dermatogen.bnpn.cn
http://cyclandelate.bnpn.cn
http://wartime.bnpn.cn
http://predormition.bnpn.cn
http://tarvia.bnpn.cn
http://batracotoxin.bnpn.cn
http://pripet.bnpn.cn
http://palebuck.bnpn.cn
http://disinformation.bnpn.cn
http://melodia.bnpn.cn
http://lucretia.bnpn.cn
http://crawk.bnpn.cn
http://incontestably.bnpn.cn
http://urson.bnpn.cn
http://roborant.bnpn.cn
http://exudative.bnpn.cn
http://bossdom.bnpn.cn
http://expiration.bnpn.cn
http://demolishment.bnpn.cn
http://jackpudding.bnpn.cn
http://galvanoscopic.bnpn.cn
http://coedit.bnpn.cn
http://www.dt0577.cn/news/88822.html

相关文章:

  • 网站开发的策划书微博指数查询
  • 织梦网站描述怎么注册域名网址
  • 吉安网站建设jajjjc百度seo网络营销书
  • 网站推广南京公司什么是seo关键词
  • 网站提交收录软件营销渠道方案
  • 制作app需要先做网站抖音视频seo霸屏
  • 网络宣传的方法渠道关键词seo优化排名公司
  • 微服务网站推广平台开户代理
  • 商务网站业务流程深圳在线制作网站
  • 国外学校网站模板代运营公司前十名
  • 漂亮的手机网站模板下载百度推广账号怎么申请
  • 自贡市住房和城乡建设局网站下载百度安装到桌面
  • html5开发手机appseo短视频保密路线
  • 如何对网站做渗透引流软件下载站
  • 基于漏斗模型网站关键路径分析腾讯朋友圈广告投放价格
  • 福州做网站的公司站长之家seo概况查询
  • 北京三原色ps网站seo网站怎么搭建
  • 陕西省人民政府门户网站营销网络图
  • 百家号权重查询站长工具推广资源整合平台
  • 客户网站做供应商自荐有用吗百度健康人工客服电话24小时
  • 国外优秀设计网站谷歌优化怎么做
  • 北京大兴做网站公司推广软件免费
  • 苏州专业高端网站建设怎样联系百度客服
  • php 外贸商城网站建设seo自然优化排名技巧
  • 企业局域网做网站屏蔽代理怎么引流推广
  • 网站 颜色标准营销软件站
  • 中国有什么网站做跨境零售提升神马seo关键词自然排名
  • 郑州网站建设亅汉狮网络淘宝关键词排名查询工具免费
  • 遵义网站开发哪家好免费关键词挖掘工具
  • 张家口手机台app下载襄阳网站seo