Skip to content

Commit

Permalink
ENV for WINDOW-SIZE
Browse files Browse the repository at this point in the history
ENV : STOMP_CONSUMER_WIN_SIZE
  • Loading branch information
ngaspari committed May 14, 2024
1 parent 7eb5d8c commit e0d28a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/stomp.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
* Heartbeat which we will be sending to server at given millisecond period.
*/
'send_heartbeat' => env('STOMP_SEND_HEARTBEAT', 20000),

'consumer_window_size' => env('STOMP_CONSUMER_WIN_SIZE', 2),

/**
* Array of supported versions.
Expand Down
5 changes: 4 additions & 1 deletion src/Queue/StompQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,14 @@ protected function subscribeToQueues(): void
if ($alreadySubscribed) {
continue;
}

$winSize = Config::get('consumer_window_size') ?? 2;

$this->client->subscribe($queue, null, 'client', [
// New Artemis version can't work without this as it will consume only first message otherwise.
//'consumer-window-size' => '-1',
'consumer-window-size' => '2',
// we can define this if we are using ack mode = client
'consumer-window-size' => (string)$winSize,
]);

$this->subscribedTo[] = $queue;
Expand Down

0 comments on commit e0d28a5

Please sign in to comment.