{"id":15631879,"url":"https://github.com/freyo/laravel-queue-cmq","last_synced_at":"2026-03-07T00:31:01.295Z","repository":{"id":50100261,"uuid":"110770731","full_name":"freyo/laravel-queue-cmq","owner":"freyo","description":"📦 Tencent Cloud Message Queue driver for Laravel Queue","archived":false,"fork":false,"pushed_at":"2021-08-19T05:07:57.000Z","size":123,"stargazers_count":26,"open_issues_count":1,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-16T17:20:33.776Z","etag":null,"topics":["cmq","cmq-queue","cmq-topic","laravel","laravel-queues","php","queue-drivers"],"latest_commit_sha":null,"homepage":"https://intl.cloud.tencent.com/product/cmq","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/freyo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-15T02:07:12.000Z","updated_at":"2022-08-29T09:01:16.000Z","dependencies_parsed_at":"2022-08-03T19:15:10.573Z","dependency_job_id":null,"html_url":"https://github.com/freyo/laravel-queue-cmq","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/freyo/laravel-queue-cmq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freyo%2Flaravel-queue-cmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freyo%2Flaravel-queue-cmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freyo%2Flaravel-queue-cmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freyo%2Flaravel-queue-cmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freyo","download_url":"https://codeload.github.com/freyo/laravel-queue-cmq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freyo%2Flaravel-queue-cmq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30204154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmq","cmq-queue","cmq-topic","laravel","laravel-queues","php","queue-drivers"],"created_at":"2024-10-03T10:41:57.404Z","updated_at":"2026-03-07T00:31:01.265Z","avatar_url":"https://github.com/freyo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimage src=\"https://imgcache.qq.com/open_proj/proj_qcloud_v2/international/doc/css/img/icon/icon-zzj.svg\" width=\"150\" height=\"150\"\u003e\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003eTencent Cloud Message Queue Driver for Laravel Queue\u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"LICENSE\"\u003e\n      \u003cimage src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\" alt=\"Software License\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/freyo/laravel-queue-cmq\"\u003e\n      \u003cimage src=\"https://img.shields.io/travis/freyo/laravel-queue-cmq/master.svg?style=flat-square\" alt=\"Build Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://scrutinizer-ci.com/g/freyo/laravel-queue-cmq\"\u003e\n      \u003cimage src=\"https://img.shields.io/scrutinizer/coverage/g/freyo/laravel-queue-cmq.svg?style=flat-square\" alt=\"Coverage Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://scrutinizer-ci.com/g/freyo/laravel-queue-cmq\"\u003e\n      \u003cimage src=\"https://img.shields.io/scrutinizer/g/freyo/laravel-queue-cmq.svg?style=flat-square\" alt=\"Quality Score\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/freyo/laravel-queue-cmq\"\u003e\n      \u003cimage src=\"https://img.shields.io/packagist/v/freyo/laravel-queue-cmq.svg?style=flat-square\" alt=\"Packagist Version\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/freyo/laravel-queue-cmq\"\u003e\n      \u003cimage src=\"https://img.shields.io/packagist/dt/freyo/laravel-queue-cmq.svg?style=flat-square\" alt=\"Total Downloads\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://app.fossa.io/projects/git%2Bgithub.com%2Ffreyo%2Flaravel-queue-cmq?ref=badge_small\"\u003e\n      \u003cimg src=\"https://app.fossa.io/api/projects/git%2Bgithub.com%2Ffreyo%2Flaravel-queue-cmq.svg?type=small\" alt=\"FOSSA Status\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## Installation\n\n  ```shell\n  composer require freyo/laravel-queue-cmq\n  ```\n\n## Configure\n\n**Laravel 5.5+ uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.**\n\n1. `config/app.php`:\n\n  ```php\n  'providers' =\u003e [\n    // ...\n    Freyo\\LaravelQueueCMQ\\LaravelQueueCMQServiceProvider::class,\n  ]\n  ```\n  \n2. `.env`:\n\n  ```\n  QUEUE_DRIVER=cmq\n  \n  CMQ_SECRET_KEY=\n  CMQ_SECRET_ID=\n  \n  CMQ_QUEUE_HOST=https://cmq-queue-{region}.api.qcloud.com\n  CMQ_QUEUE=queue_name #default queue name\n  CMQ_QUEUE_POLLING_WAIT_SECONDS=0\n  \n  CMQ_TOPIC_ENABLE=false # set to true to use topic\n  CMQ_TOPIC_FILTER=routing # or msgtag\n  CMQ_TOPIC_HOST=https://cmq-topic-{region}.api.qcloud.com\n  CMQ_TOPIC=topic_name\n  ```\n  \n#### Tips\n  \n- Region should be replaced with a specific region: gz (Guangzhou), sh (Shanghai), or bj (Beijing).\n  \n- Domain for public network API request: cmq-queue-region.api.qcloud.com / cmq-topic-region.api.qcloud.com\n  \n- Domain for private network API request: cmq-queue-region.api.tencentyun.com / cmq-topic-region.api.tencentyun.com\n  \n## Usage\n\nOnce you completed the configuration you can use Laravel Queue API. If you used other queue drivers you do not need to change anything else. If you do not know how to use Queue API, please refer to the official Laravel documentation: http://laravel.com/docs/queues\n\n### Example\n\n#### Dispatch Jobs\n\nThe default connection name is `cmq`\n\n  ```php\n  //use queue only\n  Job::dispatch()-\u003eonConnection('connection-name')-\u003eonQueue('queue-name');\n  // or dispatch((new Job())-\u003eonConnection('connection-name')-\u003eonQueue('queue-name'))\n  \n  //use topic and tag filter\n  Job::dispatch()-\u003eonConnection('connection-name')-\u003eonQueue('tag1,tag2,tag3');\n  // or dispatch((new Job())-\u003eonConnection('connection-name')-\u003eonQueue('tag1,tag2,tag3'))\n  \n  //use topic and routing filter\n  Job::dispatch()-\u003eonConnection('connection-name')-\u003eonQueue('routing-key');\n  // or dispatch((new Job())-\u003eonConnection('connection-name')-\u003eonQueue('routing-key'))\n  ```\n\n#### Multiple Queues\n\nConfigure `config/queue.php`\n\n```php\n'connections' =\u003e [\n    //...\n    'new-connection-name' =\u003e [\n        'driver' =\u003e 'cmq',\n        'secret_key' =\u003e 'your-secret-key',\n        'secret_id'  =\u003e 'your-secret-id',\n        'queue' =\u003e 'your-queue-name',\n        'options' =\u003e [\n            'queue' =\u003e [\n                'host'                 =\u003e 'https://cmq-queue-region.api.qcloud.com',\n                'name'                 =\u003e 'your-queue-name',\n                'polling_wait_seconds' =\u003e 0, // 0-30 seconds\n                'retries'              =\u003e 3,\n            ],\n            'topic' =\u003e [\n                'enable'  =\u003e false,\n                'filter'  =\u003e 'routing', // routing or msgtag\n                'host'    =\u003e 'https://cmq-topic-region.api.qcloud.com',\n                'name'    =\u003e 'your-topic-name',\n                'retries' =\u003e 3,\n            ],\n        ],\n        'plain' =\u003e [\n            'enable' =\u003e false,\n            'job' =\u003e 'App\\Jobs\\CMQPlainJob@handle',\n        ],\n    ];\n    //...\n];\n```\n\n#### Process Jobs\n\n```bash\nphp artisan queue:work {connection-name} --queue={queue-name}\n```\n\n#### Plain Mode\n\nConfigure `.env`\n\n```\nCMQ_PLAIN_ENABLE=true\nCMQ_PLAIN_JOB=App\\Jobs\\CMQPlainJobHandler@handle\n```\n\nCreate a job implements `PlainPayload` interface. The method `getPayload` must return a sting value.\n\n```php\n\u003c?php\n\nnamespace App\\Jobs;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Freyo\\LaravelQueueCMQ\\Queue\\Contracts\\PlainPayload;\n\nclass CMQPlainJob implements ShouldQueue, PlainPayload\n{\n    use Dispatchable, InteractsWithQueue, Queueable;\n    \n    protected $payload;\n\n    /**\n     * Create a new job instance.\n     *\n     * @return void\n     */\n    public function __construct($payload)\n    {\n        $this-\u003epayload = $payload;\n    }\n    \n    /**\n     * Get the plain payload of the job.\n     *\n     * @return string\n     */\n    public function getPayload()\n    {\n        return $this-\u003epayload;\n    }\n}\n```\n\nCreate a plain job handler\n\n```php\n\u003c?php\n\nnamespace App\\Jobs;\n\nuse Illuminate\\Queue\\Jobs\\Job;\n\nclass CMQPlainJobHandler\n{\n    /**\n     * Execute the job.\n     * \n     * @param \\Illuminate\\Queue\\Jobs\\Job $job\n     * @param string $payload\n     * \n     * @return void\n     */\n    public function handle(Job $job, $payload)\n    {\n        // processing your payload...\n        var_dump($payload);\n        \n        // release back to the queue manually when failed.\n        // $job-\u003erelease();\n        \n        // delete message when processed.\n        if (! $job-\u003eisDeletedOrReleased()) {\n            $job-\u003edelete();\n        }        \n    }\n}\n```\n\n## References\n\n- [Product Documentation](https://intl.cloud.tencent.com/document/product/406)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Ffreyo%2Flaravel-queue-cmq.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Ffreyo%2Flaravel-queue-cmq?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreyo%2Flaravel-queue-cmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreyo%2Flaravel-queue-cmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreyo%2Flaravel-queue-cmq/lists"}