question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to create a Pulsar function

See original GitHub issue

Describe the bug We are trying to create a Pulsar function and deploy that in a bare-metal cluster we already have. We are creating the Exclamation function(exfun.py) given in the example as follows

bin/pulsar-admin functions create --py exfun.py --classname ExclamationFunction --tenant public --namespace default --name process --inputs test-in-1 --output test-out-1

But it gives the following error

null
Reason: java.lang.NumberFormatException: For input string: "8080,fyp2:8080"

We are having a 2-node cluster with the following configuration:

bin/pulsar initialize-cluster-metadata --cluster pulsar-cluster-1 --zookeeper fyp1:2181 --web-service-url http://fyp1:8080,fyp2:8080 --broker-service-url pulsar://fyp1:6650,fyp2:6650 --configuration-store fyp1:2181

Can you please help us here @jiazhai @sijie ? Thanks 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
elgcacommented, Aug 30, 2020

@vishalananth07 it will still work in a distributed manner. but the initial topic lookup will hit service unavailability if the broker goes down. @zymap is fixing the issue. we hopefully will merge this issue soon next week.

When I run the official tutorial, I got the same problem, right?

[pulsar@pulsar-node3 apache-pulsar-2.6.1]$ bin/pulsar-admin functions create \
>   --jar examples/api-examples.jar \
>   --classname org.apache.pulsar.functions.api.examples.ExclamationFunction \
>   --inputs persistent://public/default/exclamation-input \
>   --output persistent://public/default/exclamation-output \
>   --tenant public \
>   --namespace default \
>   --name exclamation
java.lang.ClassCastException: java.lang.NumberFormatException cannot be cast to org.apache.pulsar.client.admin.PulsarAdminException
        at org.apache.pulsar.client.admin.internal.FunctionsImpl.createFunction(FunctionsImpl.java:324)
        at org.apache.pulsar.admin.cli.CmdFunctions$CreateFunction.runCmd(CmdFunctions.java:657)
        at org.apache.pulsar.admin.cli.CmdFunctions$BaseCommand.run(CmdFunctions.java:97)
        at org.apache.pulsar.admin.cli.CmdBase.run(CmdBase.java:71)
        at org.apache.pulsar.admin.cli.PulsarAdminTool.run(PulsarAdminTool.java:240)
        at org.apache.pulsar.admin.cli.PulsarAdminTool.main(PulsarAdminTool.java:282)

0reactions
brouwerorangecommented, Mar 16, 2020

@vishalananth07 in case of me, I faced same issue when I set webServiceUrl as more than one brokers in client.conf. maybe you can try to set one broker in webServiceUrl.

Best regard

Read more comments on GitHub >

github_iconTop Results From Across the Web

Develop Pulsar Functions
If a Pulsar Function uses the language-native interface for Java or Python, that function is not able to publish metrics and stats to...
Read more >
Apache Pulsar: Access state storage in LocalRunner not ...
I'm trying to implement a simple Apache Pulsar Function and access the State API in LocalRunner mode, but it's not working. pom.xml snippet...
Read more >
Pulsar Function CRD configurations
This document lists CRD configurations available for Pulsar Functions. The CRD configurations for Pulsar Functions consist of Function configurations and ...
Read more >
Pulsar Functions | StreamNative Documentation
Pulsar Functions are lightweight compute processes that can perform the following operations: Consume messages from one or more Pulsar topics.
Read more >
Developing and Running Serverless Apache Pulsar Functions
Now let's get into how you can develop, deploy, and test your very own Pulsar Function using Astra. Now to the core: the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found