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

网站怎么做移动图片不显示不出来中国工程建设协会网站

网站怎么做移动图片不显示不出来,中国工程建设协会网站,装饰公司网站建设方案,宝塔搭建网站问题描述 在一个事务内完成插入操作#xff0c;通过MQ异步通知其他微服务进行事件处理。 由于是在事务内发送#xff0c;其他服务消费消息#xff0c;查询数据时还不存在如何解决呢#xff1f; 解决方案 通过spring-tx包的TransactionSynchronizationManager事务管理器解…问题描述 在一个事务内完成插入操作通过MQ异步通知其他微服务进行事件处理。 由于是在事务内发送其他服务消费消息查询数据时还不存在如何解决呢 解决方案 通过spring-tx包的TransactionSynchronizationManager事务管理器解决。 public abstract class TransactionSynchronizationManager {private static final ThreadLocalSetTransactionSynchronization 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.* pNote 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);SetTransactionSynchronization 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://www.yutouwan.com/news/389719/

相关文章:

  • google云 wordpressseo搜索如何优化
  • 在手机上创建网站吗网站建设督查报告
  • 常州网站建设套餐重庆谷歌seo关键词优化
  • 给企业做网站.net网站开发教程百度贴吧
  • 河北邢台路桥建设公司网站网站开发流程任务
  • 公司网站设计公司成都网站开发外包公司
  • 环保主题静态网站模板.net 导航网站模板
  • 铭誉摄影网站wordpress文章分享
  • 手机网站自助建站源码qq网页版登录官网登录入口
  • 国外 网站设计企业网站排名
  • 海南平台网站建设平台为公司做的图可以上传网站吗
  • 企业门户网站系统做外贸的怎样才能上国外网站
  • 公司推广做哪个网站吗汽车品牌推广策划方案
  • 新时代文明实践站模板微商做网站网站
  • 淘宝的网站建设的目标wordpress调用文章标签名
  • 深圳 网站建设 销售wordpress mysql配置
  • 公司网站建设的系统功能需求分析c 网站开发 图书下载
  • 做网站首页代码大学科研项目做网站
  • 建站套餐和定制网站的区别网站设计的国际专业流程是什么
  • 微信建设网站哪家好哪里有免费的网站域名
  • 网站标题大全惠州市网络推广
  • 网站认证收费吗网站推广策略方法
  • 郑州注册公司网站安卓手机优化软件排名
  • 网络安全技术吉林seo技术交流
  • 创新的成都网站建设备案名 网站名
  • 中国最好的网站建设公司苏州高端网站建设设计公司
  • 如何查看网站抓取频率网站代码输入完成之后要怎么做
  • 跨境电商建站新品发布会海报
  • 服装网站建设物流配送系统一键优化win10
  • 阳江市建设路龙源学校网站国内自建站