Skip to content
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

Stop ack-ing unprocessed pubsub messages and log warnings #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hkan
Copy link
Member

@hkan hkan commented Mar 20, 2024

The problem with current code is that if we forget to add a proto class to mappings, but add the event handler, the relevant pubsub messages will be discarded. That's not desirable. We want to not acknowledge the messages if the event is unprocessable.

}
$handledMessages[] = $message;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's plenty of service that don't and won't get a handler for the message, meaning message will never get acked and will be retried many times. Don't think that's the aim here.

Copy link
Member Author

@hkan hkan Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right. The goal of this PR is to stop ack-ing the pubsub messages for the events that are registered in handlers array of app-events.php but does not have the relevant proto class in mappings array of the same file. But I just noticed that I need to change the AppEventFactory for that, too. Will add changes in a minute. I'll see what I can change to reach that goal.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a bit more change to make that happen and I fall into the trap of updating everything unrelated but necessary.

@hkan hkan requested a review from andvla May 3, 2024 14:51
@hkan
Copy link
Member Author

hkan commented May 3, 2024

With the latest changes, I will publish this as a new major version.

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

Successfully merging this pull request may close these issues.

2 participants