Skip to content

feat(kafka-logger): add TLS support for Kafka brokers#13607

Open
ecsimsw wants to merge 5 commits into
apache:masterfrom
ecsimsw:feat/kafka-logger-tls-support
Open

feat(kafka-logger): add TLS support for Kafka brokers#13607
ecsimsw wants to merge 5 commits into
apache:masterfrom
ecsimsw:feat/kafka-logger-tls-support

Conversation

@ecsimsw

@ecsimsw ecsimsw commented Jun 25, 2026

Copy link
Copy Markdown

Description

  • Add TLS option to kafka-logger and error-log-logger plugins for connecting to TLS-enabled Kafka brokers such as AWS MSK.
  • APISIX uses lua-resty-kafka for Kafka produce, and lua-resty-kafka already supports ssl/ssl_verify in broker_config.
  • However, APISIX plugins were not exposing these options to users.
  • This PR adds a tls object schema so users can enable TLS connections.
  • The tls object design allows future extension for mTLS support.

Changes

  • kafka-logger.lua : add tls schema + pass ssl/ssl_verify to broker_config
  • error-log-logger.lua : same change
  • kafka-logger-tls.t : schema validation + integration tests via SSL port (9093)
  • error-log-logger-kafka.t : schema validation + integration tests for TLS
  • kafka-logger.md, error-log-logger.md : add tls attributes and usage examples

Which issue(s) this PR fixes:

Verification

  • Tested against AWS MSK (Real world, TLS-only) : TLS handshake and metadata fetch confirmed working.
  • luacheck: passed locally (0 warnings / 0 errors)
  • check-test-code-style.sh: passed locally
  • lj-releng: requires LuaJIT 2.1 (not available locally), to be verified by CI

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kafka security_protocol Does kafka support SASL_SSL?

1 participant