Think queue message queue for PHP Message Queuing first Experience

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.