Message Queuing think queue with thinkphp 5
PHP Think Queue:listen--queue queuename
PHP think Queue:work--daemon--queue xwyqueue
Using these two commands for Message Queuing monitoring, the entire Linux operating interface is closed, the discovery will not be able to run.
The reason is that this process is not resident in the system background. Then it is necessary to use the supervisor of the Liunx operating system to ensure that the process resides
In the Baidu Search Supervisor installation Use
Then configure the supervisor.conf file.
[program:php]
Command=/usr/bin/php think Queue:work--queue xwyqueue--daemon; Monitored processes
directory=/www/website/weixin/
;p rocess_name=% (process_num) 02d
; Numprocs=5 #启动几个进程
Autostart=true; starts with the start of Supervisord
autorestart=true; auto-start
Startsecs=1: The number of seconds to stay in the runing state when the program restarts
STARTRETRIES=10: The maximum number of retries when starting a failure
Redirect_stderr=true redirect stderr to stdout
Stdout_logfile=/root/supervisor.log; stdout file
After the configuration is done
Start the Supervisor Service
Supervisord-c/etc/supervisor/supervisord.conf
When the following message appears in the Execute command:
Error:another program was already listening on a port the one of our HTTP servers are configured to use. Shut This program down first before starting Supervisord.
For help, Use/usr/bin/supervisord–h
is because an application that uses Supervisor configuration is running and needs to execute SUPERVISORCTL shutdown command termination
Supervisorctl Status #查看所有任务状态
I, Qiu Feng, phper, currently entrepreneurship, do project system development Mutual learning together increase number: qiufeng2983
Think queue message queue for PHP Message Queuing first Experience