Skip to content

Conversation

@TsuyoshiUshio
Copy link

Summary

Adds first-class Kafka trigger and output binding support to the Node.js programming model, including Schema Registry URL configuration.

Changes

  • Add types/kafka.d.ts with full type definitions for Kafka bindings
  • Update types/index.d.ts to export Kafka types
  • Update types/app.d.ts with kafka() function declaration
  • Update types/trigger.d.ts with kafka trigger function
  • Update types/output.d.ts with kafka output function
  • Update src/app.ts with kafka() implementation
  • Update src/trigger.ts with kafkaTrigger binding
  • Update src/output.ts with kafka output binding

Kafka Binding Options

Trigger Options

  • brokerList, topic, consumerGroup
  • schemaRegistryUrl, schemaRegistryUsername, schemaRegistryPassword
  • authenticationMode, protocol, username, password
  • SSL certificate locations
  • cardinality, lagThreshold

Output Options

  • brokerList, topic
  • schemaRegistryUrl, schemaRegistryUsername, schemaRegistryPassword
  • authenticationMode, protocol, username, password
  • SSL certificate locations
  • batchSize, maxMessageBytes, enableIdempotence

Related

Azure DevOps Task #33855170 - Schema registry URL for out of proc languages

- Add types/kafka.d.ts with full type definitions for Kafka bindings
- Update types/index.d.ts to export Kafka types
- Update types/app.d.ts with kafka() function declaration
- Update types/trigger.d.ts with kafka trigger function
- Update types/output.d.ts with kafka output function
- Update src/app.ts with kafka() implementation
- Update src/trigger.ts with kafkaTrigger binding
- Update src/output.ts with kafka output binding

Kafka binding options include:
- brokerList, topic, consumerGroup (trigger)
- schemaRegistryUrl, schemaRegistryUsername, schemaRegistryPassword
- authenticationMode, protocol, username, password
- SSL certificate locations
- cardinality, lagThreshold (trigger)
- batchSize, maxMessageBytes, enableIdempotence (output)
@TsuyoshiUshio TsuyoshiUshio requested a review from a team as a code owner January 22, 2026 23:03
@swapnil-nagar
Copy link
Contributor

Link: #192

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class Kafka trigger and output binding support to the Node.js programming model, including Schema Registry URL-related configuration surfaced via public types and binding helpers.

Changes:

  • Introduces Kafka binding type definitions (KafkaTriggerOptions, KafkaOutputOptions, and related function option types).
  • Exposes kafka(...) helpers in the trigger, output, and app namespaces.
  • Re-exports Kafka types from the public types/index.d.ts entrypoint.

Reviewed changes

Copilot reviewed 3 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
types/kafka.d.ts Adds public TypeScript types for Kafka trigger/output bindings and function options, including Schema Registry settings.
types/index.d.ts Re-exports Kafka types from the main public types entrypoint.
types/app.d.ts Declares app.kafka(...) registration API in the public programming model surface.
types/trigger.d.ts Declares trigger.kafka(...) helper and links to Kafka trigger docs.
types/output.d.ts Declares output.kafka(...) helper and links to Kafka output docs.
src/app.ts Implements app.kafka(...) by converting to generic options and using the Kafka trigger helper.
src/trigger.ts Implements trigger.kafka(...) binding object creation with type: 'kafkaTrigger'.
src/output.ts Implements output.kafka(...) binding object creation with type: 'kafka'.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +134 to +139
export function kafka(options: KafkaTriggerOptions): KafkaTrigger {
return addTriggerBindingName({
...options,
type: 'kafkaTrigger',
});
}
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

Add unit coverage for the new trigger.kafka(...) helper (similar to existing http/storage tests) to verify the generated binding metadata includes the expected type: 'kafkaTrigger', direction 'in', and deterministic auto-generated binding name. test/converters/toCoreFunctionMetadata.test.ts already validates other trigger/output helpers, but Kafka isn’t covered yet.

Copilot uses AI. Check for mistakes.
Comment on lines +120 to +125
export function kafka(options: KafkaOutputOptions): KafkaOutput {
return addOutputBindingName({
...options,
type: 'kafka',
});
}
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

Add unit coverage for the new output.kafka(...) helper to validate the generated output binding metadata (e.g., type: 'kafka', direction 'out', and deterministic auto-generated binding name). This behavior is covered for other outputs in test/converters/toCoreFunctionMetadata.test.ts, but Kafka output isn’t included.

Copilot uses AI. Check for mistakes.
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.

3 participants