php - 主服务器向从服务器发送消息,如何保证消息一定到达,然后限制时间(如5s内)?
世界只因有你
世界只因有你 2017-05-16 13:13:42
0
3
369

上次面试一家java的公司面试的人问我的,如何保证可靠性和时间呢?

世界只因有你
世界只因有你

reply all(3)
Ty80

There are many factors, there is no way to guarantee delivery within 5 seconds:

  • The network is down, can it be delivered within 5 seconds?

  • The server is hanging and cannot receive data

  • The server is down and the data cannot be received

  • The server is too busy to process, and the thread that receives the message has not been executed in time

As long as the service can be connected, or even if the service is disconnected and reconnected, MQ can ensure that the message is sent to the message recipient as soon as possible, but the specific time is as mentioned above, depending on whether the service can be accessed and the service processing capability

漂亮男人

Set error callback mechanism, timeout callback, and arrival callback. Or use an MQ queue.

巴扎黑

timeout 5s No waiting for overdue items

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!