James Treleaven
06/10/2024, 6:39 PMFunctionConfig functionConfig = new FunctionConfig();
> functionConfig.setTenant(tenant);
> functionConfig.setNamespace(namespace);
> functionConfig.setName(functionName);
> functionConfig.setRuntime(FunctionConfig.Runtime.JAVA);
> functionConfig.setParallelism(1);
> functionConfig.setClassName("org.apache.pulsar.functions.api.examples.ExclamationFunction");
> functionConfig.setProcessingGuarantees(FunctionConfig.ProcessingGuarantees.ATLEAST_ONCE);
> functionConfig.setTopicsPattern(sourceTopicPattern);
> functionConfig.setSubName(subscriptionName);
> functionConfig.setAutoAck(true);
> functionConfig.setOutput(sinkTopic);
> admin.functions().createFunction(functionConfig, fileName);
But I am having trouble. Might anybody be able to point me to some example Java code that preferably comes with a pom.xml file which: (i) pulls the necessary Pulsar libraries and (ii) just builds ... to create a working executable that actually successfully deploys a function using code like the last line in the code snippet above?
If I have that to work backwards from I am confident that I will be able to get my code working.
I would think there must be at least one working example program (that does this) somewhere.Alexander Preuß
06/11/2024, 6:31 AMJames Treleaven
06/11/2024, 12:59 PMJames Treleaven
06/11/2024, 1:02 PMAlexander Preuß
06/11/2024, 5:10 PM