Skip to content

Skip invalid Kafka messages during Fetch#774

Merged
jfallows merged 4 commits intoaklivity:developfrom
ankitk-me:invalidMessage
Feb 4, 2024
Merged

Skip invalid Kafka messages during Fetch#774
jfallows merged 4 commits intoaklivity:developfrom
ankitk-me:invalidMessage

Conversation

@ankitk-me
Copy link
Contributor

No description provided.

Copy link
Contributor

@jfallows jfallows left a comment

Choose a reason for hiding this comment

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

Looks good, we just need to improve the log messages.

timestamp namespace.binding: Skipping invalid message on topic abc, partition N, offset M

?

Comment on lines +518 to +519
System.out.println(String.format("%s %s: Skipping invalid message on topic %s, partition %d, offset %d",
System.currentTimeMillis(), bindingName, topic, id, offset));
Copy link
Contributor

Choose a reason for hiding this comment

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

Later, we're going to be logging to the EngineContext, and we usually don't pass strings around for bindings, just binding ids.

Let's change the method signature to put EngineContext and bindingId as the first 2 parameters. Note that bindingId is already there as routedId in KafkaCacheServerFetchFanout.

Suggested change
System.out.println(String.format("%s %s: Skipping invalid message on topic %s, partition %d, offset %d",
System.currentTimeMillis(), bindingName, topic, id, offset));
System.out.printf("%s:%s %s: Skipping invalid message on topic %s, partition %d, offset %d\n",
System.currentTimeMillis(), context.supplyNamespace(bindingId), context.supplyLocalName(bindingId), topic, id, offset);

Also, let's put these printfs inside conditional if based on EngineConfiguration.verbose().

@jfallows jfallows merged commit bd3d0f2 into aklivity:develop Feb 4, 2024
@ankitk-me ankitk-me deleted the invalidMessage branch February 5, 2024 14:23
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