Skip to content

Conversation

@gfoltz
Copy link

@gfoltz gfoltz commented Jan 6, 2024

This fixes #957 and #129

A generic KafkaJSProtocolError is thrown when a kafka client tries to use a topic that is unknown to the broker or unauthorized for the client. Including the topic name in these cases is very useful for debugging because it allows the engineer to more rapidly know what needs to change with their cluster.

This PR includes the following:

  1. A new KafkaJSUnknownTopic error which includes a topic property
  2. A new KafkaJSTopicAuthorizationFailed error which includes a `topic property
  3. When logging is enabled, the error.topic value is included in the log context with the log line.

@gfoltz gfoltz force-pushed the gfoltz/unknownUnauthorizedTopicLogging branch 2 times, most recently from 6cdc768 to e32865c Compare January 7, 2024 05:16
@gfoltz gfoltz force-pushed the gfoltz/unknownUnauthorizedTopicLogging branch from e32865c to 07084ef Compare January 7, 2024 05:27
@TiMESPLiNTER
Copy link

Thanks a lot for your work. We're also missing something like this. So we can see what permission is missing for which topic. I really hope this one will make it into a a release asap.

@gfoltz
Copy link
Author

gfoltz commented Feb 16, 2024

@Nevon @tulios Can you approve?

@DjellalAbdou
Copy link

I was doing literally this PR before finding it here, I think it is a really good thing to add ASAP

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.

Provide additional metadata in errors

3 participants