Skip to content

Conversation

@ocadaruma
Copy link
Member

@ocadaruma ocadaruma commented Sep 2, 2025

Motivation

  • We sometimes want to use kafka-client's Deserializer directly on ProcessorsBuilder#consuming. for example:
    • To deserialize DecatonClient tasks using record-header information
  • Using TaskExtractor is not an option here, because:
    • When TaskExtractor is used, TaskMetadata construction becomes implementer's responsibility, while we intentionally avoid exposing public API to extract DecatonClient's taskMetadata from header

Summary of changes

  • ProcessorsBuilder#consuming now have an overload that accepts kafka.common.serialization.Deserializer<T>, which can be used to deserialize tasks using topic, record headers and custom TaskMetadata extraction logic is not necessary

@ocadaruma ocadaruma marked this pull request as ready for review September 2, 2025 06:02
@ocadaruma ocadaruma changed the title Allow customizing deserializer to apply transformation Allow build processors using kafka-clients Deserializer Sep 3, 2025
@ocadaruma ocadaruma force-pushed the custom-deserializer branch 2 times, most recently from fa25a55 to 233b813 Compare September 8, 2025 13:08
consumeManager.close();
quotaApplier.close();
metrics.close();
processors.close();
Copy link
Contributor

Choose a reason for hiding this comment

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

hm, should we surround these close calls and log failure one-by-one?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, that might be good

Copy link
Contributor

@kawamuray kawamuray left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@kawamuray kawamuray merged commit e1ab6ad into line:master Sep 17, 2025
6 checks passed
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