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

feat: claim pending messages from other consumers #20

Merged
merged 4 commits into from
May 12, 2023

Conversation

navinkarkera
Copy link
Contributor

Mirror of open-craft#1 as github does not allow changing PRs across forks.

@openedx-webhooks
Copy link

Thanks for the pull request, @navinkarkera! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

db: Walrus object for redis connection.
full_topic: topic prefixed with environment name.
consumer: consumer instance.
"""

def __init__(self, topic, group_id, signal, consumer_name, last_read_msg_id=None, check_backlog=False):
def __init__(self, topic, group_id, signal, consumer_name, last_read_msg_id=None, check_backlog=False,
claim_msgs_older_than=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this flag documented anywhere? It seems like the default behavior will be to never claim, which seems wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

(Not necessarily wrong that it won't claim messages, but that there's no doc explaining that you probably really do want this set to some other value. I think a sensible default would be somewhere in the range of a minute if we wanted to add one, since it needs to be long enough that an long-running jobs won't accidentally get double processed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bmtcril It is documented above in line 96. Do you have a suggestion for a default idle time? This behavior is similar to kafka event bus by default as it also doesn't claim messages from other consumers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm I meant more in a "as a site operator deploying this, how would I know what this flag is and what to set it to", but it actually looks like we don't have any of that kind of documentation right now? I think it's unrelated to this PR, but would be good to provide a doc of how to run in production as well as a list of all of the settings and command line options in the docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh we commented at the same time. We could add some examples along with the tutor/devstack docs that we are working on in the other ticket explaining all the flags and their default values.

@bmtcril bmtcril merged commit 86c7f12 into openedx:main May 12, 2023
@openedx-webhooks
Copy link

@navinkarkera 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@navinkarkera navinkarkera deleted the navin/claim-msgs branch June 1, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants