Skip to content

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

Closed
@Munkhdemberel

Description

@Munkhdemberel

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions