Skip to content

[connector-http] 支持自定义 HTTP headers via ConfigOption#32

Open
featzhang wants to merge 2 commits intoapache:mainfrom
featzhang:feature/support-custom-http-headers
Open

[connector-http] 支持自定义 HTTP headers via ConfigOption#32
featzhang wants to merge 2 commits intoapache:mainfrom
featzhang:feature/support-custom-http-headers

Conversation

@featzhang
Copy link
Member

Add formal ConfigOption definitions for custom HTTP headers in both the HTTP lookup source and HTTP dynamic sink connectors.

Previously, custom HTTP headers were only configurable via raw properties using the prefixes 'http.source.lookup.header.' and 'http.sink.header.', but these were not declared as official ConfigOptions. This meant no IDE autocomplete support, missing documentation, and unclear user guidance.

Changes:

  • Add SOURCE_LOOKUP_HEADERS ConfigOption (Map type) to HttpLookupConnectorOptions with prefix 'http.source.lookup.header'
  • Add SINK_HEADERS ConfigOption (Map type) to HttpDynamicSinkConnectorOptions with prefix 'http.sink.header'
  • Register both options in the respective factory's optionalOptions() so Flink's table option validator recognizes them
  • Add tests verifying custom headers can be specified in SQL DDL without triggering ValidationException

The header values are still passed through Properties and read by the existing HttpHeaderUtils.prepareHeaderMap() mechanism, so the runtime behavior is unchanged. The new ConfigOptions serve primarily as documentation and validation anchors.

Add formal ConfigOption definitions for custom HTTP headers in both
the HTTP lookup source and HTTP dynamic sink connectors.

Previously, custom HTTP headers were only configurable via raw properties
using the prefixes 'http.source.lookup.header.' and 'http.sink.header.',
but these were not declared as official ConfigOptions. This meant no IDE
autocomplete support, missing documentation, and unclear user guidance.

Changes:
- Add SOURCE_LOOKUP_HEADERS ConfigOption (Map type) to
  HttpLookupConnectorOptions with prefix 'http.source.lookup.header'
- Add SINK_HEADERS ConfigOption (Map type) to
  HttpDynamicSinkConnectorOptions with prefix 'http.sink.header'
- Register both options in the respective factory's optionalOptions()
  so Flink's table option validator recognizes them
- Add tests verifying custom headers can be specified in SQL DDL
  without triggering ValidationException

The header values are still passed through Properties and read by the
existing HttpHeaderUtils.prepareHeaderMap() mechanism, so the runtime
behavior is unchanged. The new ConfigOptions serve primarily as
documentation and validation anchors.
Add documentation for the formal ConfigOption support of custom HTTP headers
(http.source.lookup.header.* and http.sink.header.*) introduced in FLINK-HTTP-3.

Changes:
- Add http.source.lookup.header.* entry to Lookup Source Connector Options table
- Update Http headers section for Lookup Source to note formal ConfigOption support
- Add http.sink.header.* entry to Sink Connector Options table
- Add new 'Sink Http headers' section with SQL DDL example
- Update TOC to include new Sink Http headers section
- Apply same changes to both English and Chinese documentation
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.

1 participant