Function Outputs

Function Outputs

Output is a component that the function can send data to, include:

For example, here you can find an async function with a cron input binding and a Kafka output binding:

  1. apiVersion: core.openfunction.io/v1beta2
  2. kind: Function
  3. metadata:
  4. name: cron-input-kafka-output
  5. spec:
  6. ...
  7. serving:
  8. ...
  9. outputs:
  10. - dapr:
  11. name: kafka-server
  12. type: bindings.kafka
  13. operation: "create"
  14. bindings:
  15. kafka-server:
  16. type: bindings.kafka
  17. version: v1
  18. metadata:
  19. - name: brokers
  20. value: "kafka-server-kafka-brokers:9092"
  21. - name: topics
  22. value: "sample-topic"
  23. - name: consumerGroup
  24. value: "bindings-with-output"
  25. - name: publishTopic
  26. value: "sample-topic"
  27. - name: authRequired
  28. value: "false"

Here is another async function example that use a Kafka Pub/sub component as input.

  1. apiVersion: core.openfunction.io/v1beta2
  2. kind: Function
  3. metadata:
  4. name: autoscaling-subscriber
  5. spec:
  6. ...
  7. serving:
  8. ...
  9. runtime: "async"
  10. outputs:
  11. - dapr:
  12. name: kafka-server
  13. type: pubsub.kafka
  14. topic: "sample-topic"
  15. pubsub:
  16. kafka-server:
  17. type: pubsub.kafka
  18. version: v1
  19. metadata:
  20. - name: brokers
  21. value: "kafka-server-kafka-brokers:9092"
  22. - name: authRequired
  23. value: "false"
  24. - name: allowedTopics
  25. value: "sample-topic"
  26. - name: consumerID
  27. value: "autoscaling-subscriber"