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

Minor Reader Improvements #315

Merged
merged 5 commits into from
Mar 25, 2024
Merged

Minor Reader Improvements #315

merged 5 commits into from
Mar 25, 2024

Conversation

Tang8330
Copy link
Collaborator

@Tang8330 Tang8330 commented Mar 25, 2024

Changes

Main changes here are:

  1. Making public functions that don't need to be public, private.
  2. Removing the pointer from converting raw message into Kafka message
  3. Making the Adapter for PostgreSQL and MySQL public as they are being returned

@Tang8330 Tang8330 marked this pull request as ready for review March 25, 2024 17:47
for i, msg := range msgs {
topic := fmt.Sprintf("%s.%s", cfg.TopicPrefix, msg.TopicSuffix)
kMsg, err := NewMessage(topic, msg.PartitionKey, msg.GetPayload())
func (b *BatchWriter) buildKafkaMessages(rawMsgs []lib.RawMessage) ([]kafka.Message, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't see a need to make cfg a ptr

@Tang8330 Tang8330 requested a review from nathan-artie March 25, 2024 17:48
// If it's retryable, you need to reload the Kafka client.
func RetryableError(err error) bool {
func retryableError(err error) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

isRetryableError for consistency with isExceedMaxMessageBytesErr?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sgtm

@Tang8330 Tang8330 merged commit 232cbd1 into master Mar 25, 2024
3 checks passed
@Tang8330 Tang8330 deleted the minor-reader-improvements branch March 25, 2024 18:17
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