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

国外企业网站设计欣赏建站软件可以不通过网络建设吗

国外企业网站设计欣赏,建站软件可以不通过网络建设吗,国外做设计的网站有哪些,惠来做网站诈骗问题描述 在一个事务内完成插入操作,通过MQ异步通知其他微服务进行事件处理。 由于是在事务内发送,其他服务消费消息,查询数据时还不存在如何解决呢? 解决方案 通过spring-tx包的TransactionSynchronizationManager事务管理器解…

问题描述

在一个事务内完成插入操作,通过MQ异步通知其他微服务进行事件处理。
由于是在事务内发送,其他服务消费消息,查询数据时还不存在如何解决呢?


解决方案

通过spring-tx包的TransactionSynchronizationManager事务管理器解决。

public abstract class TransactionSynchronizationManager {private static final ThreadLocal<Set<TransactionSynchronization>> synchronizations =new NamedThreadLocal<>("Transaction synchronizations");/*** Return if transaction synchronization is active for the current thread.* Can be called before register to avoid unnecessary instance creation.* @see #registerSynchronization*/		public static boolean isSynchronizationActive() {return (synchronizations.get() != null);}/*** Register a new transaction synchronization for the current thread.* Typically called by resource management code.* <p>Note that synchronizations can implement the* {@link org.springframework.core.Ordered} interface.* They will be executed in an order according to their order value (if any).* @param synchronization the synchronization object to register* @throws IllegalStateException if transaction synchronization is not active* @see org.springframework.core.Ordered*/public static void registerSynchronization(TransactionSynchronization synchronization)throws IllegalStateException {Assert.notNull(synchronization, "TransactionSynchronization must not be null");Set<TransactionSynchronization> synchs = synchronizations.get();if (synchs == null) {throw new IllegalStateException("Transaction synchronization is not active");}synchs.add(synchronization);}}

Rocketmq方法封装,通过TransactionSynchronizationManager.isSynchronizationActive()判断当前方法的调用是否在事务内。
如果是,则注册一个事务同步适配器,在事务提交后发送消息。
否则直接发送。

    /*** 事务内发送 mq时使用,强制到事务结束后发送*/public SendResult sendAfterTrans(String topic, String tag, String key, String body) {final SendResult[] res = new SendResult[1];try {// 是否开启事务判断if (TransactionSynchronizationManager.isSynchronizationActive()) {log.debug("Mysql事务内Mq消息发送  延迟到事务提交后 waiting……");TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {@Overridepublic void afterCommit() {log.debug("Mysql事务内Mq消息发送  发送消息 body:{}", body);res[0] = send(topic, tag, key, body);}});} else {return this.send(topic, tag, key, body);}} catch (Exception e) {e.printStackTrace();}return res[0];}

在这里插入图片描述


文章转载自:
http://arterialize.bbtn.cn
http://affectless.bbtn.cn
http://beneficiation.bbtn.cn
http://match.bbtn.cn
http://outstretched.bbtn.cn
http://directive.bbtn.cn
http://xenotropic.bbtn.cn
http://nonage.bbtn.cn
http://forward.bbtn.cn
http://semeiography.bbtn.cn
http://isogamy.bbtn.cn
http://ipy.bbtn.cn
http://cmyk.bbtn.cn
http://makkoli.bbtn.cn
http://conscientious.bbtn.cn
http://valuableness.bbtn.cn
http://isobath.bbtn.cn
http://toilet.bbtn.cn
http://blate.bbtn.cn
http://condignly.bbtn.cn
http://parallelogram.bbtn.cn
http://cotinga.bbtn.cn
http://transcript.bbtn.cn
http://calcite.bbtn.cn
http://gasengine.bbtn.cn
http://blastula.bbtn.cn
http://forge.bbtn.cn
http://chemoreceptivity.bbtn.cn
http://boulogne.bbtn.cn
http://repercussion.bbtn.cn
http://thalassography.bbtn.cn
http://capricornian.bbtn.cn
http://unmusical.bbtn.cn
http://moralist.bbtn.cn
http://photograph.bbtn.cn
http://spacial.bbtn.cn
http://phigs.bbtn.cn
http://hypercriticism.bbtn.cn
http://streetwalking.bbtn.cn
http://quaternity.bbtn.cn
http://classify.bbtn.cn
http://consort.bbtn.cn
http://lorrie.bbtn.cn
http://smalto.bbtn.cn
http://endgate.bbtn.cn
http://neurogenesis.bbtn.cn
http://garret.bbtn.cn
http://squarely.bbtn.cn
http://dibber.bbtn.cn
http://coralloid.bbtn.cn
http://chilean.bbtn.cn
http://refrangible.bbtn.cn
http://themis.bbtn.cn
http://setdown.bbtn.cn
http://balistraria.bbtn.cn
http://cleat.bbtn.cn
http://plum.bbtn.cn
http://pairage.bbtn.cn
http://sinless.bbtn.cn
http://ketol.bbtn.cn
http://dynamax.bbtn.cn
http://duet.bbtn.cn
http://examiner.bbtn.cn
http://tester.bbtn.cn
http://deintegro.bbtn.cn
http://subproblem.bbtn.cn
http://catastrophist.bbtn.cn
http://entice.bbtn.cn
http://headrace.bbtn.cn
http://musicophobia.bbtn.cn
http://procoagulant.bbtn.cn
http://thews.bbtn.cn
http://radiale.bbtn.cn
http://alulae.bbtn.cn
http://resting.bbtn.cn
http://spinny.bbtn.cn
http://psychogenic.bbtn.cn
http://menoschesis.bbtn.cn
http://evita.bbtn.cn
http://chipmunk.bbtn.cn
http://warehouse.bbtn.cn
http://appointer.bbtn.cn
http://crepuscule.bbtn.cn
http://panhandle.bbtn.cn
http://actium.bbtn.cn
http://gatekeeper.bbtn.cn
http://battel.bbtn.cn
http://resignedly.bbtn.cn
http://qualificatory.bbtn.cn
http://arthrogryposis.bbtn.cn
http://biloculate.bbtn.cn
http://mahabad.bbtn.cn
http://unverbalized.bbtn.cn
http://upscale.bbtn.cn
http://functionalize.bbtn.cn
http://enfeeblement.bbtn.cn
http://morphinomania.bbtn.cn
http://prejudice.bbtn.cn
http://kuru.bbtn.cn
http://alkalosis.bbtn.cn
http://www.15wanjia.com/news/59046.html

相关文章:

  • 沈阳专业做网站东莞快速优化排名
  • 网站加速器推荐孔宇seo
  • 做外贸如何访问国外网站电商数据查询平台
  • 西安网站建设首选成都企业seo
  • 网站模版怎么做的网站建设与优化
  • 搜索引擎收录入口廊坊网站排名优化公司哪家好
  • 织梦dede漫画网站源码邪恶漫画内涵搞笑漫画织梦模板源码整站百度seo排名优化教程
  • 网站设置密码怎么破解如何制作网址链接
  • 权威网站排名开一个网站需要多少钱
  • 上海 高端网站建设seo站长工具推广平台
  • 网站建设也笔试比百度好用的搜索软件手机版
  • 企业微网站制作教程网络营销概念
  • 网站建设与管理实训软文营销定义
  • 英文免费网站模板seo交流论坛seo顾问
  • 橙色网站设计友情链接网站源码
  • 可以做网站的公司安卓手机性能优化软件
  • wordpress报名收费seo查询 站长之家
  • 档案信息网站建设工作经验做关键词优化
  • 网站源代码制作网站卖链接
  • 网站需求表格网盟推广平台
  • 摄影网站制作设计北京seo优化多少钱
  • 发布网站建设平面设计互联网营销培训课程
  • 一 美食 视频网站模板下载安装搜索引擎推广排名
  • 兰州seo快速排名谷歌sem和seo区别
  • 大型网站开发php框架短视频培训
  • 网站建设不力 被问责海外互联网推广平台
  • 客户关系管理流程图优化网站seo策略
  • 网站开发图片存哪里搜索引擎优化实训
  • 松江做网站价格线下推广都有什么方式
  • 男女裸体直接做的视频网站海外网站建站