监控MySQL从不同的应用程序插入 [英] Monitor MySQL inserts from different application

查看:74
本文介绍了监控MySQL从不同的应用程序插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个web服务,它使用Hibernate在mysql数据库中插入信息。其中一些信息需要由另一个导入应用程序处理。我想不必从web服务中触发这个应用程序。因此,web服务没有依赖web服务,反之亦然。

有没有办法在数据库中侦听更改(特别是:插入)? '导入'应用程序,然后开始执行操作。我查看了触发器,但这些似乎只适用于应用程序的Hibernate Session中的更改,而不适用于'外部'更改。


$ b

编辑*

总之,我想要的答案是;
是否可以监视来自java应用程序的不改变数据库/表本身的mysql数据库/表(来自任何源)的更改



赏金更新*



我会奖励那些可以向我解释如何监控对MySQL表/数据库所做更改的人一个Java应用程序。监视更改的Java应用程序不是应用程序应用程序的任何更改。您可以阅读 com / doc / refman / 5.0 / en / binary-log.htmlrel =noreferrer> mysql二进制日志。在这里你可以找到一些信息。有一个 Java解析器另一个 - 但它被标记为未完成),您也可以使用其他语言查找类似的解析器(例如, perl )并用Java重写它们。

另请参阅 mysql-proxy


I currently have a webservice which inserts information in a mysql database using Hibernate. Some of this information needs to be processed by another 'import' application. I would like to not have to trigger this application from the webservice. So the webservice doesn't have a dependency on the webservice and visa versa.

Is there a way to "listen" to changes (specifically: insert) in the database from the 'import' application and then start executing an action. I have looked at triggers but these seem to only work for changes in the application's Hibernate Session and not for 'external' changes.

Edit*

In short, the answer I would like to have; Is it possible to monitor changes to a mysql database/table (coming from any source) from a java application which does not alter the database/table itself

Bounty Update*

I will award the bounty to the person who can explain to me how to monitor changes made to a MySQL table/database using a Java application. The Java application monitoring the changes is not the application applying any changes. The source of the alterations can be anything.

解决方案

You can read mysql binary log. Here you can find some information. There is a java parser and another one - but it is marked as unfinished) also you can look for similar parsers using another languages (for example, perl) and rewrite them in Java.
Also have a look at mysql-proxy.

这篇关于监控MySQL从不同的应用程序插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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