Web服务和网站之间的集成
我有一些 Web 服务在 Apache 的中央服务器(Debian)上运行。 我有多个调用这些网络服务的远程计算机。 其中一个 Web 服务是状态/运行状况检查 Web 服务 - 每台远程计算机都有一个 cronjob,每分钟调用一次状态 Web 服务。基本上,此状态 Web 服务的目的是将请求发送回计算机,作为对状态 Web 服务的响应。
我还有一个网站在同一台中央服务器上运行。我想在状态网络服务和状态网络服务之间进行通信网站。
即有人可以点击网站上的一个选项&要求将请求“X”发送到远程计算机“Y”。如果 Web 服务是一个正在运行的进程,则网站只需将其传达给 Web 服务即可。 Web 服务下次从该机器收到状态调用时会发送此消息。
然而,由于网络服务不是一个过程 - 我对如何实现这一点感到困惑 - 有人有任何建议吗?
一切都在 Apache/PHP 上运行。
I have some web services running on a central server(Debian) on Apache.
I have multiple remote machines which call these webservices.
One of the webservice is a status/healthcheck webservice - each remote machine has a cronjob which calls the status webservice every minute. Basically the point of this status webservice is to send requests back to the machines as a response to the status webservice.
I also have a website running on the same central server. I want to have communication between the status webservice & the website.
i.e. someone can click on an option on the website & ask to send request 'X' to Remote Machine 'Y'. If the webservice were a running process, the website would just communicate this to the webservice & the webservice would send this next time it gets a status call from that Machine.
However, since the webservice is not a process - I am confused as to how I can achieve this - does anyone have any suggestions.
Everything is running on Apache/PHP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以拥有一个包含以下字段的数据库表:id、request、remote_machine、已处理并立即保存来自网站的请求。
稍后,当远程计算机每次调用运行状况检查 Web 服务时,它都可以查询该表以查找与远程计算机匹配且已处理 = 0 的请求。然后,它可以将请求作为响应发送到运行状况检查 Web 服务。
希望这有帮助。
You can have a DB table with these fields: id, request, remote_machine, processed and save the request from the website here immediately.
Later when each time the remote machines call the health check web service, it can query that table for request matching the remote machine and processed = 0. It can then send the request as a response to the health check web service.
Hope this helps.