From da47b92b7c29be1a3e88a1d4aecd8720f121c031 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Fri, 22 Mar 2024 13:53:56 +0800 Subject: [PATCH] Setup priority queue with AWS SQS (Sync from Shipping Portal) --- .../Bookings/ControllersLogic/ListBookingJobLogic.php | 2 +- .../Documents/ControllersLogic/ListDocumentJobLogic.php | 2 +- .../ControllersLogic/ListTransactionsJobLogic.php | 2 +- vapor.yml | 9 +++++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/ListBookingJobLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/ListBookingJobLogic.php index ef3570f7..827f7f2a 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/ListBookingJobLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/ListBookingJobLogic.php @@ -62,7 +62,7 @@ class ListBookingJobLogic extends AbstractControllerLogic $userInfo ); - ListBookingsJob::dispatch($listGenericJobObject); + ListBookingsJob::dispatch($listGenericJobObject)->onQueue(env('SQS_QUEUENAME_PREFIX', '').'high_priority'); $result = []; $result['job_id'] = $jobId; diff --git a/app/Classes/Modules/Documents/ControllersLogic/ListDocumentJobLogic.php b/app/Classes/Modules/Documents/ControllersLogic/ListDocumentJobLogic.php index 5e895ad8..c49b58d2 100644 --- a/app/Classes/Modules/Documents/ControllersLogic/ListDocumentJobLogic.php +++ b/app/Classes/Modules/Documents/ControllersLogic/ListDocumentJobLogic.php @@ -63,7 +63,7 @@ class ListDocumentJobLogic extends AbstractControllerLogic $userInfo ); - ListDocumentsJob::dispatch($listGenericJobObject); + ListDocumentsJob::dispatch($listGenericJobObject)->onQueue(env('SQS_QUEUENAME_PREFIX', '').'high_priority'); $result = []; $result['job_id'] = $jobId; diff --git a/app/Classes/Modules/Transactions/ControllersLogic/ListTransactionsJobLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/ListTransactionsJobLogic.php index 654a360f..76dd2e9f 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/ListTransactionsJobLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/ListTransactionsJobLogic.php @@ -61,7 +61,7 @@ class ListTransactionsJobLogic extends AbstractControllerLogic $userInfo ); - ListTransactionsJob::dispatch($listGenericJobObject); + ListTransactionsJob::dispatch($listGenericJobObject)->onQueue(env('SQS_QUEUENAME_PREFIX', '').'high_priority'); $result = []; $result['job_id'] = $jobId; diff --git a/vapor.yml b/vapor.yml index 38d4e1a6..a0d31602 100644 --- a/vapor.yml +++ b/vapor.yml @@ -6,6 +6,9 @@ environments: domain: production.exchange.izyim.com memory: 1024 cli-memory: 512 + queues: + - exchange-default-production + - exchange-high_priority-production database: cief-rds-mysql storage: exchange-2.0-production # gateway-version: 2 @@ -30,6 +33,9 @@ environments: domain: staging.exchange.izyim.com memory: 1024 cli-memory: 512 + queues: + - exchange-default-staging + - exchange-high_priority-staging database: cief-rds-mysql storage: exchange-2.0-staging runtime: 'docker' @@ -45,6 +51,9 @@ environments: domain: dev.exchange.izyim.com memory: 1024 cli-memory: 512 + queues: + - exchange-default-development + - exchange-high_priority-development database: cief-rds-mysql storage: exchange-2.0-development runtime: 'docker'