We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please is there any plan to add support for Typescript/Node functions in v4 programming model?
The text was updated successfully, but these errors were encountered:
v4 can be used, but there should be updated documentation, and best case a trigger in https://github.com/Azure/azure-functions-nodejs-library/blob/v4.x/src/app.ts
I'm just dropping my "solution", which is inspired by https://github.com/Azure/azure-functions-kafka-extension/tree/dev/samples/typescript
import { app, FunctionTrigger, GenericFunctionOptions, InvocationContext } from '@azure/functions'; const kafkaFunctionTrigger: FunctionTrigger = { type: 'kafkaTrigger', name: 'TransferrerKafkaFunctionTrigger', direction: 'in', topic: '%EVENT_HUB_NAME%', brokerList: '%BrokerList%', username: '$ConnectionString', password: 'EVENT_HUB_CONNECTION_STRING', protocol: 'saslSsl', authenticationMode: 'plain', consumerGroup: 'a-consumer-group', dataType: 'string', }; const transferrerKafkaFunctionOptions: GenericFunctionOptions = { handler: eventHubAsKafkaConsumer, trigger: kafkaFunctionTrigger, }; app.generic('eventHubAsKafkaConsumer', transferrerKafkaFunctionOptions); // This is to describe the metadata of a Kafka event class KafkaEvent { Offset: number; Partition: number; Topic: string; Timestamp: string; Value: string; constructor(metadata: any) { this.Offset = metadata.Offset; this.Partition = metadata.Partition; this.Topic = metadata.Topic; this.Timestamp = metadata.Timestamp; this.Value = metadata.Value; } } export async function eventHubAsKafkaConsumer(event_str: string, context: InvocationContext): Promise<void> { let event_obj = new KafkaEvent(eval(event_str)); context.log('Event Offset: ' + event_obj.Offset); context.log('Event Partition: ' + event_obj.Partition); context.log('Event Topic: ' + event_obj.Topic); context.log('Event Timestamp: ' + event_obj.Timestamp); context.log('>>> Event Value via KAFKA (as string): ' + event_obj.Value); }
Sorry, something went wrong.
No branches or pull requests
Please is there any plan to add support for Typescript/Node functions in v4 programming model?
The text was updated successfully, but these errors were encountered: