premforgame opened a new issue #8469:
URL: https://github.com/apache/pulsar/issues/8469


   **Describe the bug**
   
   There are two ways to develop a custom pulsar function. 1.) by implementing 
interface Function 2.) by implementing WindowFunction. 
   
   Custom pulsar function that is developed using interface Function has a null 
issue When we try to create function  with options --window-length-duration-ms 
or --window-length-count. 
   This issue observed in Pulsar version:2.6.1 and Pulsar version-all :2.6.1
   
   bin/pulsar-admin functions create \--jar test.jar --classname 
com.abcd.xyz.mnop.qrst.function.sample --inputs input --output test --name 
samplefunction --window-length-count 30000
   null
   
   Reason: null
   
   
   **To Reproduce**
   Steps to reproduce the behavior:
   
   1. Develop a custom pulsar function by implementing  interface Function
   ```
   public class sample implements Function<String, Void> {
   
       @Override   
       public Void process(String input, Context context) throws Exception {
           System.out.println("Test:"+input);
           return null;
       }
   }
   ```
   2. Generate the jar (sample.jar )for this custom pulsar function
   3. Deploy the generated jar (sample.jar) in pulsar container by docker cp 
sample.jar <pulsar container id>:/pulsar 
   4. login/run the container by docker exec -it <pulsar container id> /bin/bash
   5. Now execute the following command bin/pulsar-admin functions create 
\--jar sample.jar --classname com.abcd.xyz.mnop.qrst.function.sample --inputs 
input --output test --name samplefunction --window-length-count 300
   Following error occur
    
   
![image](https://user-images.githubusercontent.com/26475477/98422804-c36e8600-20b2-11eb-8a14-54585584e9c5.png)
   
   
   **Expected behavior**
   Pulsar function should be created with --window-length-duration-ms and 
--window-length-count options
   
   **Screenshots**
   NA
   
   **Desktop (please complete the following information):**
    - OS: Windows 10, Pulsar in Docker image. Docker version: 2.2.0.4 
   
   **Additional context**
   NA
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to