1

I've written several custom-purpose Unix programs in C/C++ to parse inbound data files and insert records into a database. I would like to give the customer the ability to monitor the status of these programs from one or more Windows PCs. What's the best way, in this day and age, to communicate between the two?

Back in the day, I used to do this kind of thing by writing sets of dedicated client/server TCP/IP socket-level programs on both machines, using a home-grown protocol to request program status and generate responses. The Windows side would ping the Unix side every minute or so, and the Unix side would reply with various counts of records awaiting processing, records processed that day, MTD, and YTD (mostly simple file counts in a given directory but also database lookups). The Windows side could also tell the Unix side to restart, or to move a problematic record to a "hold" area... that sort of thing. Both sides included a dedicated "parent" process to make sure all the child processes continued to run, or would restart them if they died.

But that was back in the 80's and early 90's. Is there any newer, better, more reliable technology to do basically the same thing in this day and age? My speciality is in C/C++/C#, but I could implement something web based given a good tutorial. Also I'd like to stick to custom code or free/open-source solutions.

Is my hand-written TCP/IP client/server approach still the best thing for this situation?

Thanks for your time!

4

1 回答 1

0

RabbitMQAMQP 的实现)将是解决您的问题的一个很好且相当容易实现的解决方案。

您可以在您选择的平台上安装服务器,并且有许多客户端库,包括 Java 和 .NET,只需几行代码即可发布消息。

RabbitMQ 能为您做什么?[概述摘录]

消息传递使软件应用程序能够连接和扩展。应用程序可以相互连接,作为更大应用程序的组件,或者连接到用户设备和数据。消息传递是异步的,通过分离发送和接收数据来解耦应用程序。

您可能正在考虑数据传递、非阻塞操作或推送通知。或者您想使用发布/订阅、异步处理或工作队列。所有这些都是模式,它们构成了消息传递的一部分。

RabbitMQ 是一个消息传递代理——消息传递的中介。它为您的应用程序提供了一个发送和接收消息的通用平台,并为您的消息提供了一个安全的地方,直到收到为止。

于 2012-12-24T18:02:03.243 回答