Add lazy-transformer to KeyClassifier for deferred header decoding#11466
Conversation
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
|
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
|
/merge |
|
View all feedbacks in Devflow UI.
PR already in the queue with status waiting |
What does this do
Adds a default generic method to
AgentPropagation.KeyClassifier:The default applies the transformer eagerly and delegates to
accept(String, String), so existing classifiers need no changes.Motivation
Some carriers store header values in raw form (e.g.
byte[]) and have to convert them to strings before callingaccept. Right now that conversion happens for every header, including the ones the classifier immediately ignores.An example is kafka that's decoding into base64 all the headers without knowing if it's needed.
This overload lets callers pass the raw value and a conversion function. A classifier that rejects unknown keys early never pays for the conversion at all.
The concrete follow-up is the Kafka
TextMapExtractAdapter, where Base64-decoding all message headers is wasteful and currently throwsIllegalArgumentExceptionon non-Base64 input. That fix comes in a separate PR.Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue/merge. You can also:/merge --commit-message "..."/merge -c/merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-levelJira ticket: [PROJ-IDENT]