I think the problem they are trying to solve is that the LAMP stack (of which PHP is part) is inherently connected with the request / response mechanism that the HTTP protocol imposes on it, so it has a consumer (which checks ActiveMQ ), written in PHP, is workable, but the lifetime of processes is naturally limited by any timeout in the HTTP protocol. The solution is one of:
1 - Do not run the PHP Subscriber inside apache / HTTP, and as a result, you can set_time_limit (0) and run php Subscriber forever (until it works), OR
2 - Understand that the Subscriber actually performs "periodic" checks, while nothing happens between them, so instead of while (1) {do_queue_stuff (); sleep(); } you delete the sleep mode, delete the while loop, and call it again from Cron or similar.
Each has its own advantages, but both are equally good IF the cron () frequency is fine tuned. My Cron is limited to running every minute, which is not very common, so I would have to make a combination of the following two: it is called from cron every minute:
time = what_minute_is_it (); while (what_minute_is_it () == time) {do_queue_stuff (); sleep (1); }
I think that people can follow the ActiveMQ system "hinting" at the PHP Consumer system that there may be things in the queue that need processing, and, as a result, save all these processing queues / stop / sleep / etc. if thereโs really nothing to do. A camel seems to be a way to do this.
Buzz
source share