Skip to content

Added Alias support and external resource feature changes #865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 15.0.x
Choose a base branch
from

Conversation

jjain1259
Copy link
Member

@jjain1259 jjain1259 commented Jun 24, 2025

Problem

The existing Elasticsearch Sink Connector only supports auto creation of indexes and datastreams based on Kafka topic name. This approach enforces connector-defined naming conventions and limits customers from integrating with pre-existing Elasticsearch resources. Additionally, the connector previously lacked support for writing to aliases.

Solution (INIT-8745)

This PR introduces a new feature: External Topic to Resource Mappings. This enhancement allows users to explicitly map Kafka topics to existing Elasticsearch resources—such as indices, data streams, and aliases (both index and data stream aliases).

New Configuration Parameters:

  • external.resource.usage

    • Type: String
    • Default: DISABLED
    • Valid Values: INDEX, DATASTREAM, ALIAS_INDEX, ALIAS_DATASTREAM, DISABLED
    • Purpose: Defines the type of Elasticsearch resource to target for writes.
  • topic.to.external.resource.mapping

    • Type: List (comma-separated topic:resource pairs)
    • Default: ""
    • Purpose: Provides explicit mappings between Kafka topics and Elasticsearch resources (e.g., orders:index-orders, logs:logs-ds).

Additional Notes:

  • All mapped resources must be pre-created in Elasticsearch before connector startup.
  • Each topic must map to exactly one resource (strict one-to-one mapping).
  • Enhanced validation logic to support and verify aliases during connector initialization.
Does this solution apply anywhere else?
  • yes
  • no
If yes, where?

Test Strategy

Testing done:
  • Unit tests
  • Integration tests
  • System tests
  • Manual tests

Scenarios Validated:

  • Writing to pre-created indices.
  • Writing to pre-created data streams.
  • Writing to aliases (both index and data stream).
  • Connector behavior when configured with non-existent or invalid resources.
  • Corresponding KDP tests written for the above scenarios (to be merged post-review).

Release Plan

  • Will be performing a new release: 15.1.x
  • The change is backward compatible; default behavior remains unchanged (external.resource.usage=DISABLED).
  • Changes were tested in the devel environment by deploying the new image to an existing production-exposed connector.
  • The feature will be released in both Confluent Cloud and Confluent Platform distributions.

@jjain1259 jjain1259 requested a review from a team as a code owner June 24, 2025 13:47
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@sonarqube-confluent

This comment has been minimized.

@sonarqube-confluent

This comment has been minimized.

@sonarqube-confluent
Copy link

Passed

Analysis Details

7 Issues

  • Bug 0 Bugs
  • Vulnerability 2 Vulnerabilities
  • Code Smell 5 Code Smells

Coverage and Duplications

  • Coverage 95.50% Coverage (90.60% Estimated after merge)
  • Duplications No duplication information (0.00% Estimated after merge)

Project ID: kafka-connect-elasticsearch

View in SonarQube

@jjain1259 jjain1259 requested a review from sp-gupta June 25, 2025 03:55
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