编程语言
首页 > 编程语言> > python-我需要基于Web的系统的消息/排队解决方案

python-我需要基于Web的系统的消息/排队解决方案

作者:互联网

我正在寻找在Ubuntu上运行的基于Web的系统的消息/队列解决方案.

该系统基于以下技术构建:

  • Javascript (Extjs framework) – Frontend
  • PHP
  • Python (Daemon service which interacts with the encryption device)
  • Python pyserial – (Serial port interactions)
  • MySQL
  • Linux – Ccustom bash scripts(to update DB/mail reports)

该系统具有以下目的:

  • Capture client information on a distributed platform
  • Encrypt/decrypt sensitive transactions using a Hardware device

系统故障:

  1. The user gains access to the system using a web browser
  2. The user captures client information and on pressing “submit” button
    The data is sent to the encryption device and the system enters a wait state
  3. The data is then encrypted on the device and sent back to the browser
  4. The encrypted data is saved to the DB
  5. System exits wait state and displays DONE message

请注意:我已经处理了等待/处理中的消息,所以忽略它.

到目前为止,我所做的是:

  • I created a python daemon which monitors a DB view for any new requests
  • The daemon service executes new requests on the device using pyserial and updates
    the requests table with a “response” ie. the encrypted content
  • I created a polling service in PHP which frequently checks if there is a “response” in >the requests table for the specific request
  • Created the Extjs frontend with appropriate wait/done status messages

当前设置的问题:

  • Concurreny – We expect > 20 users at any time submitting encryption/decryption requests
    using a database as a message/queuing solution is not scalable due to table locking and only 1 listening process which monitors for requests
  • Daemon service – Relying on a daemon service is a bit risky and the DB overhead seems a bit high polling the view for new requests every second
  • Development – It would simplify my development tasks by just sending requests to a encrypt/decrypt service instead of doing this whole process of inserting a request in the db,polling for the response and processing the request in the daemon service.

我的问题:

What would be the ideal message/queening solution in this situation? Please take into >account my system exclusively runs on a Ubuntu O/S.

我已经做了一些Google服务,遇到了一个名为“ Stomp”的服务器,但是事实证明它安装起来有些困难,并且缺少一些文档.我也更喜欢那些在设置类似内容方面有经验的个人的建议,而不是一些“如何”指导的建议:)

感谢您的时间

解决方法:

我相信AMQP的流行RabbitMQ实现提供了PHP扩展(here),您可以肯定地使用Python访问AMQP,例如通过Qpid.RabbitMQ也很容易在Ubuntu(或Debian)上安装,请参见例如here.

无论是通过RabbitMQ还是其他方式,与更“封闭”的解决方案相比,采用开放式消息传递和排队协议(例如AMQP)都具有明显的优势(即使从技术上讲是开源的,此类解决方案也不会提供那么多实现,因此具有灵活性) ,作为一种广泛采用的开放式标准协议).

标签:ubuntu,message-queue,python,mysql
来源: https://codeday.me/bug/20191023/1916507.html