Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

KafkaJS interface usability friction #166

Open
Labels
enhancementNew feature or request
@kylevogt

Description

Our organization currently uses KafkaJS with a private 'wrapper' library that we maintain internally that takes care much of our boilerplate usage around kafka such as emitting metrics, error handling, config mapping/defaulting, etc. I've noticed some friction with trying to use this confluent library that I don't typically experience with javascript libraries.

The first friction I ran into was the library throwing errors when there were "extra" configurations on the KafkaJS configuration object being passed in. I would expect most javascript libraries to simply ignore any extra properties. Or, at the very most log a warning about an unsupported property being included. I do understand the intention here. There are some KafkaJS configurations that are not supported and ensuring users don't expect those configs to be working is valuable. I think a warning log rather than a runtime error would be preferable here however.

The second bit of friction I ran into was the library throwing errors when a property exists on the config object but does not have a value. It's very common when mapping javascript objects/configs to "set" all config properties but have many of them be undefined. When there are undefined properties it is generally expected that they will simply be ignored. Rather than using Object.hasOwn(kjsConfig, 'metadataMaxAge') on it's own to determine if a value should be set, I'd suggest also ensuring the value !== undefined as well before adding the config key to pass to librdkafka.

I'm more than happy to expand on any of these ideas if they aren't clear. I appreciate the work going into this library particularly with KafkaJS maintainorship in flux.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /