简体   繁体   English

从Web服务器向客户端发送通知

[英]Send notification to the client from a web server

My setup consists of a Weblogic server that runs various REST services that accepts an HTTP request from a client(an android app), reads data from a MySql database and sends this data as a response to the client. 我的设置包括一个Weblogic服务器,该服务器运行各种REST服务,该服务接受来自客户端(一个android应用)的HTTP请求,从MySql数据库中读取数据,并将该数据作为响应发送给客户端。

My requirement is that the client should be notified as soon as the database is updated. 我的要求是,应在数据库更新后立即通知客户端。 I have implemented a "polling" mechanism. 我已经实现了“轮询”机制。 The client constantly sends requests and checks for any changes made in the database. 客户端不断发送请求,并检查数据库中是否有任何更改。 However this is not a very efficient mechanism. 但是,这不是一个非常有效的机制。 Can you please suggest any efficient ways of achieving this? 您能否提出实现此目标的任何有效方法?

Thanks in advance! 提前致谢!

One of the way to use writing a CRON job for observation of Database change. 一种用于编写CRON作业以观察数据库更改的方法。

also, SO has already discussed this topic. 此外,SO已经讨论了该主题。 refer below link, 请参阅下面的链接,

Oracle database to send notification / Invoke a java method on reaching Time specified in a column Oracle数据库发送通知/在到达列中指定的时间时调用java方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM