Skip to content

Conversation

itsarijitray
Copy link
Contributor

@itsarijitray itsarijitray commented Aug 26, 2025

This pull request updates the Kafka destination integration by improving the batching capabilities and clarifying authentication options. The most significant changes include adding new batching-related fields to the payload and action definition, and removing AWS IAM as a selectable authentication mechanism in the documentation and configuration.

Batching Enhancements:

  • Added enable_batching (boolean) and batch_keys (string array) fields to the Payload interface in generated-types.ts, allowing events to be optionally batched before sending to Kafka.
  • Updated the action definition in send/index.ts to support the new batching options, including labels, descriptions, default values, and hiding these fields from the UI by default.

Authentication Mechanism Clarification:

  • Removed AWS IAM as an authentication mechanism from the documentation as it is not supported at the moment and configuration for the mechanism property in both generated-types.ts and index.ts, leaving only SCRAM, PLAIN, and Client Certificate as options. [1] [2]

Screenshots:
Screenshot 2025-08-28 at 6 49 37 PM
Instance: https://app.segment.build/arijit-dev/destinations/actions-kafka/sources/http_api/instances/6880c59b62bcbb1aabdd3887/actions/mQBdMEYYKWsh6Fx2JCQeEt

Note: We need to run a ctl-plane-migration to enable batching as default for kafka.
WIP: https://github.com/segmentio/control-plane/pull/6191

Testing

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [If destination is already live] Tested for backward compatibility of destination. Note: New required fields are a breaking change.
  • [Segmenters] Tested in the staging environment
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

Comment on lines +46 to +52
enable_batching: {
type: 'boolean',
label: 'Batch Data to Kafka?',
description: 'If true, Segment will batch events before sending to Kafka.',
default: true,
unsafe_hidden: true
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be setting the max batch size too, or is that not needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No Batch size limit as such by kafka.

Comment on lines +53 to 61
batch_keys: {
label: 'Batch Keys',
description: 'The keys to use for batching the events.',
type: 'string',
unsafe_hidden: true,
required: false,
multiple: true,
default: ['partition', 'default_partition']
}
Copy link
Contributor

@joe-ayoub-segment joe-ayoub-segment Aug 29, 2025

Choose a reason for hiding this comment

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

What do these 2 keys do? What other keys are there? Will be doing a control plane migration for this field too?

@itsarijitray itsarijitray changed the base branch from main to kafka-error-handling September 1, 2025 09:16
@itsarijitray itsarijitray merged commit be54397 into kafka-error-handling Sep 1, 2025
14 checks passed
@itsarijitray itsarijitray deleted the kafka-field-updates branch September 1, 2025 09:16
itsarijitray added a commit that referenced this pull request Sep 4, 2025
* Update kafka error handling

* Update kafka error handling

* add tests

* modify error reporting

* add tests

* add tests

* add tests

* Update kafka types (#3199)

* add metrics to track batch keys

* add metrics to track batch keys

* Remove reties for kafka client

* add test

* add topic as batch keys

* add topic as batch keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants