Add first-class Kafka trigger and output binding support with Schema Registry URL#403
Add first-class Kafka trigger and output binding support with Schema Registry URL#403TsuyoshiUshio wants to merge 2 commits intov4.xfrom
Conversation
- 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)
|
Link: #192 |
There was a problem hiding this comment.
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 thetrigger,output, andappnamespaces. - Re-exports Kafka types from the public
types/index.d.tsentrypoint.
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.
| export function kafka(options: KafkaTriggerOptions): KafkaTrigger { | ||
| return addTriggerBindingName({ | ||
| ...options, | ||
| type: 'kafkaTrigger', | ||
| }); | ||
| } |
There was a problem hiding this comment.
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.
| export function kafka(options: KafkaOutputOptions): KafkaOutput { | ||
| return addOutputBindingName({ | ||
| ...options, | ||
| type: 'kafka', | ||
| }); | ||
| } |
There was a problem hiding this comment.
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.
Summary
Adds first-class Kafka trigger and output binding support to the Node.js programming model, including Schema Registry URL configuration.
Changes
Kafka Binding Options
Trigger Options
Output Options
Related
Azure DevOps Task #33855170 - Schema registry URL for out of proc languages