From 04f26dba03fec7d7ad0b04fe0a6ba49feea1b92b Mon Sep 17 00:00:00 2001 From: Zelda Ababil Date: Tue, 5 Mar 2024 16:08:20 +0700 Subject: [PATCH] queue --- app/Jobs/ProcessPrint.php | 4 +- composer.json | 6 +- composer.lock | 803 +++++++++++++++++++++++++++++++++++++- config/queue.php | 74 ++++ docker-compose.yml | 12 + 5 files changed, 893 insertions(+), 6 deletions(-) create mode 100644 docker-compose.yml diff --git a/app/Jobs/ProcessPrint.php b/app/Jobs/ProcessPrint.php index 0392299..33bbd2c 100644 --- a/app/Jobs/ProcessPrint.php +++ b/app/Jobs/ProcessPrint.php @@ -31,11 +31,11 @@ class ProcessPrint implements ShouldQueue { try { $pesanan = Pesanan::find($this->pesanan->id); - Log::info('Printing: ' . $pesanan->id); + Log::error('Printing: ' . $pesanan->id); $print = new PrintOutController(); $print->print($pesanan->id); - Log::info('Printed: ' . $pesanan->id); + Log::error('Printed: ' . $pesanan->id); } catch (\Throwable $th) { //throw $th; Log::error($th->getMessage()); diff --git a/composer.json b/composer.json index 8efe0fa..cef5f6c 100644 --- a/composer.json +++ b/composer.json @@ -9,15 +9,17 @@ "license": "MIT", "require": { "php": "^8.1", + "enqueue/amqp-bunny": "^0.10.19", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^10.10", "laravel/sanctum": "^3.3", "laravel/tinker": "^2.8", - "zelda/escpos-php": "@dev", "mpdf/mpdf": "^8.2", "realrashid/sweet-alert": "^6.0", "spatie/laravel-permission": "^6.3", - "yajra/laravel-datatables": "^10.1" + "vladimir-yuldashev/laravel-queue-rabbitmq": "^13.3", + "yajra/laravel-datatables": "^10.1", + "zelda/escpos-php": "@dev" }, "require-dev": { "fakerphp/faker": "^1.9.1", diff --git a/composer.lock b/composer.lock index 0fed1ff..535bbee 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "29ccbbf152424ed8e6403af311ce6dcc", + "content-hash": "c6faafc3700dcc26b62124ee6907b961", "packages": [ { "name": "brick/math", @@ -61,6 +61,71 @@ ], "time": "2023-01-15T23:15:59+00:00" }, + { + "name": "bunny/bunny", + "version": "v0.5.5", + "source": { + "type": "git", + "url": "https://github.com/jakubkulhan/bunny.git", + "reference": "10e34dec73397d30cb79f61dd81e9716644ede01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jakubkulhan/bunny/zipball/10e34dec73397d30cb79f61dd81e9716644ede01", + "reference": "10e34dec73397d30cb79f61dd81e9716644ede01", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "react/event-loop": "^1.0 || ^0.5 || ^0.4", + "react/promise": "~2.2" + }, + "require-dev": { + "ext-pcntl": "*", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5 || ^7.5.20", + "symfony/process": "^6.1 || ^4.4" + }, + "suggest": { + "ext-pcntl": "For using synchronous AMQP/RabbitMQ client" + }, + "type": "library", + "autoload": { + "psr-4": { + "Bunny\\": "src/Bunny/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jakub Kulhan", + "email": "jakub.kulhan@gmail.com" + } + ], + "description": "Performant pure-PHP AMQP (RabbitMQ) sync/async (ReactPHP) library", + "keywords": [ + "AMQP", + "bunny", + "exchange", + "message", + "messaging", + "queue", + "queueing", + "rabbit", + "rabbitmq", + "react", + "react-php", + "reactphp" + ], + "support": { + "issues": "https://github.com/jakubkulhan/bunny/issues", + "source": "https://github.com/jakubkulhan/bunny/tree/v0.5.5" + }, + "time": "2023-08-01T19:34:13+00:00" + }, { "name": "carbonphp/carbon-doctrine-types", "version": "2.1.0", @@ -501,6 +566,180 @@ ], "time": "2023-10-06T06:47:41+00:00" }, + { + "name": "enqueue/amqp-bunny", + "version": "0.10.19", + "source": { + "type": "git", + "url": "https://github.com/php-enqueue/amqp-bunny.git", + "reference": "f412164884a6291071a59b15a00437293ace2889" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-enqueue/amqp-bunny/zipball/f412164884a6291071a59b15a00437293ace2889", + "reference": "f412164884a6291071a59b15a00437293ace2889", + "shasum": "" + }, + "require": { + "bunny/bunny": "^0.4|^0.5", + "enqueue/amqp-tools": "^0.10", + "php": "^7.4|^8.0", + "queue-interop/amqp-interop": "^0.8.2", + "queue-interop/queue-interop": "^0.8" + }, + "require-dev": { + "enqueue/null": "0.10.x-dev", + "enqueue/test": "0.10.x-dev", + "phpunit/phpunit": "^9.5", + "queue-interop/queue-spec": "^0.6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Enqueue\\AmqpBunny\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Message Queue Amqp Transport", + "homepage": "https://enqueue.forma-pro.com/", + "keywords": [ + "AMQP", + "bunny", + "messaging", + "queue" + ], + "support": { + "docs": "https://github.com/php-enqueue/enqueue-dev/blob/master/docs/index.md", + "email": "opensource@forma-pro.com", + "forum": "https://gitter.im/php-enqueue/Lobby", + "issues": "https://github.com/php-enqueue/enqueue-dev/issues", + "source": "https://github.com/php-enqueue/enqueue-dev" + }, + "time": "2023-03-23T09:50:55+00:00" + }, + { + "name": "enqueue/amqp-tools", + "version": "0.10.19", + "source": { + "type": "git", + "url": "https://github.com/php-enqueue/amqp-tools.git", + "reference": "866d45420aa354c1b465ec7636247c3c20f67bb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-enqueue/amqp-tools/zipball/866d45420aa354c1b465ec7636247c3c20f67bb5", + "reference": "866d45420aa354c1b465ec7636247c3c20f67bb5", + "shasum": "" + }, + "require": { + "enqueue/dsn": "^0.10", + "php": "^7.4|^8.0", + "queue-interop/amqp-interop": "^0.8.2", + "queue-interop/queue-interop": "^0.8" + }, + "require-dev": { + "enqueue/null": "0.10.x-dev", + "enqueue/test": "0.10.x-dev", + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Enqueue\\AmqpTools\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Message Queue Amqp Tools", + "homepage": "https://enqueue.forma-pro.com/", + "keywords": [ + "AMQP", + "messaging", + "queue" + ], + "support": { + "docs": "https://github.com/php-enqueue/enqueue-dev/blob/master/docs/index.md", + "email": "opensource@forma-pro.com", + "forum": "https://gitter.im/php-enqueue/Lobby", + "issues": "https://github.com/php-enqueue/enqueue-dev/issues", + "source": "https://github.com/php-enqueue/enqueue-dev" + }, + "time": "2023-03-23T09:50:55+00:00" + }, + { + "name": "enqueue/dsn", + "version": "0.10.19", + "source": { + "type": "git", + "url": "https://github.com/php-enqueue/dsn.git", + "reference": "f4991fe46dd01477deb566727170341b255e8479" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-enqueue/dsn/zipball/f4991fe46dd01477deb566727170341b255e8479", + "reference": "f4991fe46dd01477deb566727170341b255e8479", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Enqueue\\Dsn\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Parse DSN", + "homepage": "https://enqueue.forma-pro.com/", + "keywords": [ + "dsn", + "parse" + ], + "support": { + "docs": "https://github.com/php-enqueue/enqueue-dev/blob/master/docs/index.md", + "email": "opensource@forma-pro.com", + "forum": "https://gitter.im/php-enqueue/Lobby", + "issues": "https://github.com/php-enqueue/enqueue-dev/issues", + "source": "https://github.com/php-enqueue/enqueue-dev" + }, + "time": "2023-03-23T09:50:55+00:00" + }, { "name": "ezyang/htmlpurifier", "version": "v4.17.0", @@ -3159,6 +3398,73 @@ ], "time": "2024-01-09T09:30:37+00:00" }, + { + "name": "paragonie/constant_time_encoding", + "version": "v2.6.3", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "58c3f47f650c94ec05a151692652a868995d2938" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938", + "reference": "58c3f47f650c94ec05a151692652a868995d2938", + "shasum": "" + }, + "require": { + "php": "^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^6|^7|^8|^9", + "vimeo/psalm": "^1|^2|^3|^4" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "time": "2022-06-14T06:56:20+00:00" + }, { "name": "paragonie/random_compat", "version": "v9.99.100", @@ -3209,6 +3515,87 @@ }, "time": "2020-10-15T08:29:30+00:00" }, + { + "name": "php-amqplib/php-amqplib", + "version": "v3.6.1", + "source": { + "type": "git", + "url": "https://github.com/php-amqplib/php-amqplib.git", + "reference": "76eee289e98b0b309a761787e65cbe1acbaf8c72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/76eee289e98b0b309a761787e65cbe1acbaf8c72", + "reference": "76eee289e98b0b309a761787e65cbe1acbaf8c72", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-sockets": "*", + "php": "^7.2||^8.0", + "phpseclib/phpseclib": "^2.0|^3.0" + }, + "conflict": { + "php": "7.4.0 - 7.4.1" + }, + "replace": { + "videlalvaro/php-amqplib": "self.version" + }, + "require-dev": { + "ext-curl": "*", + "nategood/httpful": "^0.2.20", + "phpunit/phpunit": "^7.5|^9.5", + "squizlabs/php_codesniffer": "^3.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpAmqpLib\\": "PhpAmqpLib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Alvaro Videla", + "role": "Original Maintainer" + }, + { + "name": "Raúl Araya", + "email": "nubeiro@gmail.com", + "role": "Maintainer" + }, + { + "name": "Luke Bakken", + "email": "luke@bakken.io", + "role": "Maintainer" + }, + { + "name": "Ramūnas Dronga", + "email": "github@ramuno.lt", + "role": "Maintainer" + } + ], + "description": "Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.", + "homepage": "https://github.com/php-amqplib/php-amqplib/", + "keywords": [ + "message", + "queue", + "rabbitmq" + ], + "support": { + "issues": "https://github.com/php-amqplib/php-amqplib/issues", + "source": "https://github.com/php-amqplib/php-amqplib/tree/v3.6.1" + }, + "time": "2024-02-07T17:21:26+00:00" + }, { "name": "phpoffice/phpspreadsheet", "version": "1.29.0", @@ -3389,6 +3776,116 @@ ], "time": "2023-11-12T21:59:55+00:00" }, + { + "name": "phpseclib/phpseclib", + "version": "3.0.37", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "cfa2013d0f68c062055180dd4328cc8b9d1f30b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cfa2013d0f68c062055180dd4328cc8b9d1f30b8", + "reference": "cfa2013d0f68c062055180dd4328cc8b9d1f30b8", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "^1|^2", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib3\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.37" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2024-03-03T02:14:58+00:00" + }, { "name": "psr/clock", "version": "1.0.0", @@ -3880,6 +4377,100 @@ }, "time": "2023-12-20T15:28:09+00:00" }, + { + "name": "queue-interop/amqp-interop", + "version": "0.8.2", + "source": { + "type": "git", + "url": "https://github.com/queue-interop/amqp-interop.git", + "reference": "a893c72832784ca846fcc1bd86274a6a449a1ab7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/queue-interop/amqp-interop/zipball/a893c72832784ca846fcc1bd86274a6a449a1ab7", + "reference": "a893c72832784ca846fcc1bd86274a6a449a1ab7", + "shasum": "" + }, + "require": { + "php": "^7.3 | ^8.0", + "queue-interop/queue-interop": "^0.7|^0.8|^0.9" + }, + "require-dev": { + "phpunit/phpunit": "~9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Interop\\Amqp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "AMQP interop", + "support": { + "issues": "https://github.com/queue-interop/amqp-interop/issues", + "source": "https://github.com/queue-interop/amqp-interop/tree/0.8.2" + }, + "time": "2021-01-21T11:33:30+00:00" + }, + { + "name": "queue-interop/queue-interop", + "version": "0.8.1", + "source": { + "type": "git", + "url": "https://github.com/queue-interop/queue-interop.git", + "reference": "117043fd38490f8b5516622cd4b697b33a89ce2b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/queue-interop/queue-interop/zipball/117043fd38490f8b5516622cd4b697b33a89ce2b", + "reference": "117043fd38490f8b5516622cd4b697b33a89ce2b", + "shasum": "" + }, + "require": { + "php": "^7.1.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "queue-interop/queue-spec": "^0.6@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.7-dev" + } + }, + "autoload": { + "psr-4": { + "Interop\\Queue\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of MQs objects. Based on Java JMS", + "homepage": "https://github.com/queue-interop/queue-interop", + "keywords": [ + "MQ", + "jms", + "message queue", + "messaging", + "queue" + ], + "support": { + "issues": "https://github.com/queue-interop/queue-interop/issues", + "source": "https://github.com/queue-interop/queue-interop/tree/0.8.1" + }, + "time": "2020-12-21T13:14:51+00:00" + }, { "name": "ralouphie/getallheaders", "version": "3.0.3", @@ -4105,6 +4696,150 @@ ], "time": "2023-11-08T05:53:05+00:00" }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" + }, + { + "name": "react/promise", + "version": "v2.11.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "1a8460931ea36dc5c76838fec5734d55c88c6831" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/1a8460931ea36dc5c76838fec5734d55c88c6831", + "reference": "1a8460931ea36dc5c76838fec5734d55c88c6831", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.11.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-16T16:16:50+00:00" + }, { "name": "realrashid/sweet-alert", "version": "v6.0.0", @@ -6632,6 +7367,70 @@ }, "time": "2023-12-08T13:03:43+00:00" }, + { + "name": "vladimir-yuldashev/laravel-queue-rabbitmq", + "version": "v13.3.5", + "source": { + "type": "git", + "url": "https://github.com/vyuldashev/laravel-queue-rabbitmq.git", + "reference": "2fda5722bf2b3d77e448aabcccce8d88305bcdea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vyuldashev/laravel-queue-rabbitmq/zipball/2fda5722bf2b3d77e448aabcccce8d88305bcdea", + "reference": "2fda5722bf2b3d77e448aabcccce8d88305bcdea", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/queue": "^9.0|^10.0", + "php": "^8.0", + "php-amqplib/php-amqplib": "^v3.6" + }, + "require-dev": { + "laravel/framework": "^9.0|^10.0", + "laravel/horizon": "^5.0", + "laravel/pint": "^1.2", + "mockery/mockery": "^1.0", + "orchestra/testbench": "^7.0|^8.0", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "Required to use all features of the queue consumer." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "13.0-dev" + }, + "laravel": { + "providers": [ + "VladimirYuldashev\\LaravelQueueRabbitMQ\\LaravelQueueRabbitMQServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "VladimirYuldashev\\LaravelQueueRabbitMQ\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Vladimir Yuldashev", + "email": "misterio92@gmail.com" + } + ], + "description": "RabbitMQ driver for Laravel Queue. Supports Laravel Horizon.", + "support": { + "issues": "https://github.com/vyuldashev/laravel-queue-rabbitmq/issues", + "source": "https://github.com/vyuldashev/laravel-queue-rabbitmq/tree/v13.3.5" + }, + "time": "2024-01-26T16:20:56+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v5.6.0", @@ -7364,7 +8163,7 @@ }, { "name": "zelda/escpos-php", - "version": "dev-print-controller", + "version": "dev-main-gitea", "dist": { "type": "path", "url": "./packages/escpos-php", diff --git a/config/queue.php b/config/queue.php index 01c6b05..6be71b3 100644 --- a/config/queue.php +++ b/config/queue.php @@ -71,6 +71,80 @@ return [ 'after_commit' => false, ], + 'rabbitmq' => [ + 'driver' => 'rabbitmq', + /* + * Set to "horizon" if you wish to use Laravel Horizon. + */ + 'worker' => env('RABBITMQ_WORKER', 'default'), + 'dsn' => env('RABBITMQ_DSN', null), + /* + * Could be one a class that implements \Interop\Amqp\AmqpConnectionFactory for example: + * - \EnqueueAmqpExt\AmqpConnectionFactory if you install enqueue/amqp-ext + * - \EnqueueAmqpLib\AmqpConnectionFactory if you install enqueue/amqp-lib + * - \EnqueueAmqpBunny\AmqpConnectionFactory if you install enqueue/amqp-bunny + */ + 'factory_class' => \Enqueue\AmqpBunny\AmqpConnectionFactory::class, + 'host' => env('RABBITMQ_HOST', '127.0.0.1'), + 'port' => env('RABBITMQ_PORT', 5672), + 'vhost' => env('RABBITMQ_VHOST', '/'), + 'login' => env('RABBITMQ_LOGIN', 'guest'), + 'password' => env('RABBITMQ_PASSWORD', 'guest'), + 'queue' => env('RABBITMQ_QUEUE', 'default'), + 'options' => [ + 'exchange' => [ + 'name' => env('RABBITMQ_EXCHANGE_NAME'), + /* + * Determine if exchange should be created if it does not exist. + */ + 'declare' => env('RABBITMQ_EXCHANGE_DECLARE', true), + /* + * Read more about possible values at https://www.rabbitmq.com/tutorials/amqp-concepts.html + */ + 'type' => env('RABBITMQ_EXCHANGE_TYPE', \Interop\Amqp\AmqpTopic::TYPE_DIRECT), + 'passive' => env('RABBITMQ_EXCHANGE_PASSIVE', false), + 'durable' => env('RABBITMQ_EXCHANGE_DURABLE', true), + 'auto_delete' => env('RABBITMQ_EXCHANGE_AUTODELETE', false), + 'arguments' => env('RABBITMQ_EXCHANGE_ARGUMENTS'), + ], + 'queue' => [ + /* + * Determine if queue should be created if it does not exist. + */ + 'declare' => env('RABBITMQ_QUEUE_DECLARE', true), + /* + * Determine if queue should be binded to the exchange created. + */ + 'bind' => env('RABBITMQ_QUEUE_DECLARE_BIND', true), + /* + * Read more about possible values at https://www.rabbitmq.com/tutorials/amqp-concepts.html + */ + 'passive' => env('RABBITMQ_QUEUE_PASSIVE', false), + 'durable' => env('RABBITMQ_QUEUE_DURABLE', true), + 'exclusive' => env('RABBITMQ_QUEUE_EXCLUSIVE', false), + 'auto_delete' => env('RABBITMQ_QUEUE_AUTODELETE', false), + 'arguments' => env('RABBITMQ_QUEUE_ARGUMENTS'), + ], + ], + /* + * Determine the number of seconds to sleep if there's an error communicating with rabbitmq + * If set to false, it'll throw an exception rather than doing the sleep for X seconds. + */ + 'sleep_on_error' => env('RABBITMQ_ERROR_SLEEP', 5), + /* + * Optional SSL params if an SSL connection is used + * Using an SSL connection will also require to configure your RabbitMQ to enable SSL. More details can be founds here: https://www.rabbitmq.com/ssl.html + */ + 'ssl_params' => [ + 'ssl_on' => env('RABBITMQ_SSL', false), + 'cafile' => env('RABBITMQ_SSL_CAFILE', null), + 'local_cert' => env('RABBITMQ_SSL_LOCALCERT', null), + 'local_key' => env('RABBITMQ_SSL_LOCALKEY', null), + 'verify_peer' => env('RABBITMQ_SSL_VERIFY_PEER', true), + 'passphrase' => env('RABBITMQ_SSL_PASSPHRASE', null), + ], + ], + ], /* diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3347600 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3.9" +services: + rabbitmq: + image: "rabbitmq:3-management" + hostname: "rabbit" + ports: + - "15672:15672" + - "5672:5672" + labels: + NAME: "rabbitmq" + volumes: + - ./rabbitmq-isolated.conf:/etc/rabbitmq/rabbitmq.config