基于分布式JMS的日志记录..趋于平稳? [英] Distributed JMS based logging .. falling flat?

查看:150
本文介绍了基于分布式JMS的日志记录..趋于平稳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们花哨的ESB中,每个请求的记录都是通过基于基于JMS的记录的通用基础结构完成的.简而言之,这是发生了什么:

In our fancy ESB, logging of each request is done via a common infrastructure based on JMS based logging. Here is what happens in a nutshell:

  1. 服务获得请求服务
  2. 准备LogData中的一些数据
  3. 对象服务调用数据库
  4. 数据库交互花费的时间在LogData对象中捕获
  5. 服务已准备就绪,可以发送响应
  6. LogData对象已发送到消息传递目的地
  7. 服务发送响应

非常玫瑰色!是的,对于纸张建筑师. 这是实际的问题: 由于系统级错误或软件崩溃,有时JMS服务提供程序不可用.然后,服务在必须建立JMS连接以发送LogData对象的步骤(步骤6)上等待.导致响应延迟,从而导致性能下降和用户体验下降.

Very rosey! yes for paper architects. Here is the actual issue: The JMS service provider sometimes becomes unavailable - due to a system level error or the software crashes. Then the service waits at the step (step no. 6) where it has to make JMS connection to send LogData object. Resulting in delayed response, thus leading to bad performance and user experience.

因此,这是许多开发者网站吹捧的使用JMS进行分布式日志记录"的最大缺点.还应注意,LogData的存在是一种关键的非功能性要求.这意味着消息以持久模式发送,导致等待,直到JMS提供者确认已接收到发送者的消息(在本例中为服务)-应该归咎于什么?不成熟的设计? 是否有成功实施此类操作的故事?

So that is the biggest shortcoming of "Distributed logging using JMS" touted by a lot of developer websites. Also note that the presance of LogData is kind of critical non-functional requirement. That means the messages are sent in persistent mode, leading to a wait until the JMS provider confirms receipt of message to the sender (the service in this case) - what to be blamed? immature design? Are there any success stories of implementing something like this?

推荐答案

同时在db/jms/socket/etc中进行任何日志记录都在问问题,并且有很多问题.

Doing any logging in db/jms/socket/etc synchronously is asking for problems and a lot of them.

通过登录内存和异步来实现.转储到文件/jms(取决于JMS是否可用).一个后台线程应该为您解决问题.正在同步.日志记录可能会在应用程序的完全意外和无辜的部分引起很多麻烦.

Implement it with logging into memory and async. dump to file/jms (depending if the JMS becomes available). A single background thread should do the trick for you. Having sync. logging could cause a lot of trouble in totally unexpected and innocent portions of the application.

我想不出同步的任何成功案例.记录.

I can't think of any possible success story of a sync. logging.

编辑.最好使用ConcurrentLinkedQueue之类的内容来保留LogData(我的意思是避免任何阻塞,如果可能的话,以提高性能/吞吐量)

Edit. preferrably use the like of ConcurrentLinkedQueue to keep the LogData (I mean avoid any blocking, if possible to improve the perforamce/throughput)

这篇关于基于分布式JMS的日志记录..趋于平稳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆