Skip to content

add custom HTTP headers support for Schema Registry connections#1705

Open
ymocode wants to merge 1 commit intokafbat:mainfrom
ymocode:main
Open

add custom HTTP headers support for Schema Registry connections#1705
ymocode wants to merge 1 commit intokafbat:mainfrom
ymocode:main

Conversation

@ymocode
Copy link

@ymocode ymocode commented Feb 27, 2026

Enable per-cluster schemaRegistryHeaders configuration to pass custom
headers (e.g. X-Registry-GroupId) to the Schema Registry API. This
allows scoping Apicurio Registry's Confluent compatibility endpoint
to a specific artifact group.

Config: KAFKA_CLUSTERS_0_SCHEMAREGISTRYHEADERS_=

  • Breaking change? No — new optional property, fully backward-compatible.

What changes did you make?

Added support for custom HTTP headers on Schema Registry WebClient connections, configured per cluster via schemaRegistryHeaders map.

This enables passing headers like X-Registry-GroupId to Apicurio Registry's Confluent compatibility API, scoping schema lookups to a specific artifact group.

Three files changed:

  • ClustersProperties.Cluster — added Map<String, String> schemaRegistryHeaders
  • WebClientConfigurator — added configureDefaultHeaders(Map<String, String>) method
  • KafkaClusterFactory.schemaRegistryClient() — wired headers into WebClient builder

Configuration example:
KAFKA_CLUSTERS_0_SCHEMAREGISTRYHEADERS_X-Registry-GroupId=my.artifact.group

Is there anything you'd like reviewers to focus on?

The configureDefaultHeaders method appends to the existing defaultHeaders consumer chain — verify it doesn't conflict with configureBasicAuth which also uses defaultHeaders.

How Has This Been Tested?

  • No need to
  • Manually — verified headers are sent to Apicurio Registry and schemas scoped to the configured group are returned
  • Unit checks
  • Integration checks
  • Covered by existing automation

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings (e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Check out Contributing and Code of Conduct

A picture of a cute animal (not mandatory but encouraged)

Enable per-cluster schemaRegistryHeaders configuration to pass custom
  headers (e.g. X-Registry-GroupId) to the Schema Registry API. This
  allows scoping Apicurio Registry's Confluent compatibility endpoint
  to a specific artifact group.

  Config: KAFKA_CLUSTERS_0_SCHEMAREGISTRYHEADERS_<Header-Name>=<value>
@ymocode ymocode requested a review from a team as a code owner February 27, 2026 11:54
@kapybro kapybro bot added status/triage Issues pending maintainers triage status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Feb 27, 2026
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hi ymocode! 👋

Welcome, and thank you for opening your first PR in the repo!

Please wait for triaging by our maintainers.

Please take a look at our contributing guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/triage/completed Automatic triage completed status/triage/manual Manual triage in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant