Hi team, I am trying to create an instance of a bu...
# general
o
Hi team, I am trying to create an instance of a builtin Pulsar Function using the Pulsar REST API. However, I am coming across an issue where I get the following error:
400: {"reason":"Function package is not provided"}
I am using a multi-part upload for the REST request and the entire point of using a builtin function is so that I can avoid having to specify the function package. I would appreciate guidance on how to create builtin functions using the REST API. CC: @Asaf Mesika @Ming
l
please create a question in https://github.com/apache/pulsar/discussions/categories/q-a . It's possible that this question has been answered to before. After you have created the question, you can promote the link on Slack
✅ 1
o
Thanks Lari, the question hasn’t been asked on there but I’ll look into this.
l
It's a good question and has been answered before. I also have replied once in the last few years. This time I'd like to get the Q&A recorded since the same question comes up from time to time.
✅ 1
a
@Neng
l
@Oneeb I have the answer ready for
curl
. I'll share it once you have the question ready. 🙂
🙌 1
well actually I have an example which uploads the function jar too, so not a direct response to your question
Are you using the Java client?
o
I got it to run by providing the path of the NAR file of the in the functionUrl part of the request, then I also got it to run using the JAR file path. (I had both available because I was testing the builtin approach vs the non-builtin approach). My initial confusion was coming from the fact that I was initially using package management and was passing the name of the function package to the functionURL instead of the JAR/NAR path. However, let me still ask the question for the benefit of whoever asks this next. ---- For some more context, the issue that I was facing with using the function package was that whenever the broker restarted, the function worker service wouldn’t be ready in time to retrieve the package and then I’d get a 503: Service Unavailable error and the functions would remain paused, requiring manual restarts.
Im using a Python client
Still while this addresses my concern, I was looking for an approach similar to when I would create a source or sink connector using the REST API, in which I don’t upload the required NAR, but instead just provide the
builtin://<name-of-connector>
l
Did you already create the question so that it could be answered? 😉
regarding Pulsar Functions, security adversories were published 2 days ago, https://apache-pulsar.slack.com/archives/C5Z4T36F7/p1710276335979609
o
Extremely helpful @Lari Hotari! Thanks got it to work + updating to 3.2.1 for the CVEs, thanks for sharing that as well.
thankyou 1