Skip to content

How can I create an instance of builtin Pulsar Function using the Pulsar REST API? #22266

Answered by lhotari
oneebhkhan asked this question in Q&A
Discussion options

You must be logged in to vote

when using a builtin function, it's necessary to pass builtin://<function name> in the jar key of function config.

Something like this (example using curl):

cat >/tmp/functionconfig.json <<EOF
{
  "tenant": "public",
  "namespace": "default",
  "name": "myfunction",
  "jar": "builtin://builtin-function-name",
  "runtime": "JAVA",
  "inputs": [
    "public/default/input-topic"
  ],
  "output": "public/default/output-topic",
  "autoAck": true,
  "parallelism": 1
}
EOF

curl -H "Authorization: Bearer $(cat token)" -v -X POST \
  -F "functionConfig=@/tmp/functionconfig.json;type=application/json" \
  http://pulsar-function-worker:6750/admin/v3/functions/public/default/myfunction

It's not rela…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by oneebhkhan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants