-
Notifications
You must be signed in to change notification settings - Fork 69
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
Adding a Kafka producer for sending events to the Event Bus #20895
base: master
Are you sure you want to change the base?
Conversation
# Any other errors. This should not happen and indicates trouble. | ||
Rails.logger.error "An unexpected error occurred while producing a message to #{topic}. Please check the logs for more information. This dispatch will not reach Kafka" | ||
raise e | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is in draft so please excuse me if you weren't expecting comments yet.
I'm curious about the pattern of catching the exception, sending it to the error log and then re-raising it. Why not just let the exception occur? To me, the exception class names are just as descriptive as the message that you prepend to the exception. I do see the utility of the else clause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dellerbie thanks for taking a look! The PR is indeed still being worked on but this is a valid question. I was mainly rescuing and re-raising the errors to demonstrate the types of errors that can occur and to show that we can add specific log messages and custom error handling as appropriate. This is generally an experimental feature and one challenge is to ensure that we have proper instrumentation. I will likely remove this in the (near) future once we've had some trial runs
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: app/sidekiq/kafka/example_job.rb |
Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: app/sidekiq/kafka/example_job.rb |
Generated by 🚫 Danger |
Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: config/initializers/waterdrop_client.rb |
Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: config/initializers/waterdrop_client.rb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
dev
environment with these changes.avro_turf for encoding messages in Avro format and integrating with a Schema Registry,avro gem for encoding messages in Avro format, aws-msk-iam-sasl-signer for authenticating to the Event Bus,and testcontainers-ruby for integration tests agains a dockerized Kafka cluster.Update
Related issue(s)
Testing done
What areas of the site does it impact?
Acceptance criteria
Requested Feedback
Once the code has been merged, the Kafka client will attempt to connect to the Event Bus based on the configured broker URLs and authentication features. This will only happen in the
dev
environment and when the feature toggle is turned on. However, connection issues are expected to occur until the connection details have been fully debugged. In that time, the Kafka client will produce some noisy logs in its attempt to connect.