Skip to content

laravel reverb + next js google cloud run hosted (Missing some values for example 7 of 10 events) #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Munkhdemberel opened this issue Mar 6, 2025 · 2 comments

Comments

@Munkhdemberel
Copy link

Reverb Version

2.0.2

Laravel Version

10

PHP Version

8

Description

in a test purpose, created below:

Route::get('/test-item/{subId}', function ($subId) {
// Retry logic: Retry 3 times with 3 seconds delay between attempts
$maxRetries = 3;
$retryDelay = 3; // in seconds

$result = retry($maxRetries, function () use ($subId) {
    try {
        // Dispatch the event to broadcast
        Log::info("🚀 Sending Event: ID={$subId}");
        event(new PMSEquipmentStateChanged('Төхөөрөмжийн төлөв шинэчлэгдсэн!'.$subId, 1, $subId));
        return true;
    } catch (\Exception $e) {
        // Log the exception if event dispatch fails
        Log::error('Event broadcast failed: ' . $e->getMessage());
        throw $e; // Rethrow exception to trigger retry
    }
}, $retryDelay);

if ($result) {
    return 'done ' . $subId;
} else {
    return 'Failed to send event after retrying.';
}

});

class PMSEquipmentStateChanged is implemented ShouldBroadcastNow

Also, it triggers and receives values. But the issue is
After production moves, I am only receiving 7 of 10 events.
So what can be the possible issue? There is no error log
. Should I check it on the next.js side or the backend side?

What kind of configurations do I need to add? I need to be
sure where to start check?

Image

as you can see extra == 10 is is lost and never comes. But queue is succeeded without error.

i am receiving events also below tests but I send 5 events and showing below.

Image

is it bug or what kind of behaviour and where should I check?

Steps To Reproduce

laravel new bug-report --github="--public".

@joedixon
Copy link
Collaborator

Hey @Munkhdemberel, if you run the command in debug mode (php artisan reverb:start --debug), you should see the messages actually being broadcast via the terminal or logs, along with any issues the server encounters.

@joedixon
Copy link
Collaborator

Closing due to inactivity, but please reopen if you're still running into the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants