Skip to content

Commit 74734db

Browse files
SWR-15367 #comment Bandwidth Splitting
1 parent f68fdb6 commit 74734db

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Only the latest version will get new features. Bug fixes will be provided using
1111

1212
| Package Version | Laravel Version | Bug Fixes Until | |
1313
|-----------------|-----------------|---------------------|---------------------------------------------------------------------------------------------|
14-
| 1 | 11 | December 26th, 2024 | [Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/master/README.md) |
14+
| 1 | 12 | December 26th, 2024 | [Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/master/README.md) |
1515

1616
## Installation
1717

1818
You can install this package via composer using this command:
1919

2020
```
21-
composer require salesmessage/php-lib-rabbitmq:^1.11 --ignore-platform-reqs
21+
composer require salesmessage/php-lib-rabbitmq:^1.12 --ignore-platform-reqs
2222
```
2323

2424
The package will automatically register itself.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"extra": {
3636
"branch-alias": {
37-
"dev-master": "1.11-dev"
37+
"dev-master": "1.12-dev"
3838
},
3939
"laravel": {
4040
"providers": [

src/Console/ScanVhostsCommand.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,20 @@ private function processVhost(array $vhostApiData): ?VhostApiDto
9191
$indexedSuccessfully = $this->internalStorageManager->indexVhost($vhostDto, $this->groups);
9292
if (!$indexedSuccessfully) {
9393
$this->warn(sprintf(
94-
'Skip indexation vhost: "%s". Messages ready: %d.',
94+
'Skip indexation vhost: "%s". Messages ready: %d. Messages unacknowledged: %d.',
9595
$vhostDto->getName(),
96-
$vhostDto->getMessagesReady()
96+
$vhostDto->getMessagesReady(),
97+
$vhostDto->getMessagesUnacknowledged()
9798
));
9899

99100
return null;
100101
}
101102

102103
$this->info(sprintf(
103-
'Successfully indexed vhost: "%s". Messages ready: %d.',
104+
'Successfully indexed vhost: "%s". Messages ready: %d. Messages unacknowledged: %d.',
104105
$vhostDto->getName(),
105-
$vhostDto->getMessagesReady()
106+
$vhostDto->getMessagesReady(),
107+
$vhostDto->getMessagesUnacknowledged()
106108
));
107109

108110
$vhostQueues = $this->queueService->getAllVhostQueues($vhostDto);
@@ -171,20 +173,22 @@ private function processVhostQueue(array $queueApiData): ?QueueApiDto
171173
$indexedSuccessfully = $this->internalStorageManager->indexQueue($queueApiDto, $this->groups);
172174
if (!$indexedSuccessfully) {
173175
$this->warn(sprintf(
174-
'Skip indexation queue: "%s". Vhost: %s. Messages ready: %d.',
176+
'Skip indexation queue: "%s". Vhost: %s. Messages ready: %d. Messages unacknowledged: %d.',
175177
$queueApiDto->getName(),
176178
$queueApiDto->getVhostName(),
177-
$queueApiDto->getMessagesReady()
179+
$queueApiDto->getMessagesReady(),
180+
$queueApiDto->getMessagesUnacknowledged()
178181
));
179182

180183
return null;
181184
}
182185

183186
$this->info(sprintf(
184-
'Successfully indexed queue: "%s". Vhost: %s. Messages ready: %d.',
187+
'Successfully indexed queue: "%s". Vhost: %s. Messages ready: %d. Messages unacknowledged: %d.',
185188
$queueApiDto->getName(),
186189
$queueApiDto->getVhostName(),
187-
$queueApiDto->getMessagesReady()
190+
$queueApiDto->getMessagesReady(),
191+
$queueApiDto->getMessagesUnacknowledged()
188192
));
189193

190194
return $queueApiDto;

src/Services/InternalStorageManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getVhostQueues(string $vhostName, string $by = 'name', bool $alp
7575
*/
7676
public function indexVhost(VhostApiDto $vhostDto, array $groups = []): bool
7777
{
78-
if ($vhostDto->getMessagesReady() > 0) {
78+
if (($vhostDto->getMessagesReady() > 0) || ($vhostDto->getMessagesUnacknowledged() > 0)) {
7979
return $this->addVhost($vhostDto, $groups);
8080
}
8181

@@ -185,7 +185,7 @@ private function getVhostStorageKeyPrefix(): string
185185
*/
186186
public function indexQueue(QueueApiDto $queueDto, array $groups): bool
187187
{
188-
if ($queueDto->getMessagesReady() > 0) {
188+
if (($queueDto->getMessagesReady() > 0) || ($queueDto->getMessagesUnacknowledged() > 0)) {
189189
return $this->addQueue($queueDto, $groups);
190190
}
191191

0 commit comments

Comments
 (0)