Audace opened a new issue #2874: 'ConsumerConfiguration' object has no 
attribute 'read_compacted'
URL: https://github.com/apache/pulsar/issues/2874
 
 
   #### Expected behavior
   
   I want to experiment with Pulsar functions. I'm running Pulsar using Docker 
in standalone mode using the image tagged `2.2.0`. I've created a file and 
added it to the image that looks like the following:
   ```{python}
   def process(input):
       return input[::-1]
   ```
   
   I register it using the following command:
   ```
   /pulsar/bin/pulsar-admin functions localrun \
       --py /functions/reverse.py \
       --className reverse.process \
       --inputs persistent://public/default/backwards \
       --output persistent://public/default/forwards \
       --tenant public \
       --namespace default \
       --name reverse
   ```
   #### Actual behavior
   
   Rather than correctly running, the process immediately errors out with the 
following stacktrace:
   ```
   pulsar_1  | 17:12:13.729 [main] INFO  
org.apache.pulsar.functions.runtime.ProcessRuntimeFactory - Java instance jar 
location is not defined, using the location defined in system environment : 
/pulsar/instances/java-instance.jar
   pulsar_1  | 17:12:13.733 [main] INFO  
org.apache.pulsar.functions.runtime.ProcessRuntimeFactory - Python instance 
file location is not defined using the location defined in system environment : 
/pulsar/instances/python-instance/python_instance_main.py
   pulsar_1  | 17:12:13.744 [main] INFO  
org.apache.pulsar.functions.runtime.RuntimeSpawner - public/default/reverse-0 
RuntimeSpawner starting function
   pulsar_1  | 17:12:13.814 [main] INFO  
org.apache.pulsar.functions.runtime.ProcessRuntime - ProcessBuilder starting 
the process with args python 
/pulsar/instances/python-instance/python_instance_main.py --py 
/functions/reverse.py --logging_directory /pulsar/logs/functions --logging_file 
reverse --instance_id 0 --function_id 73e70ca5-ca83-4899-beba-c106baa95350 
--function_version bb4ae017-79fa-4071-b264-ad8a8a392aa9 --function_details 
'{"tenant":"public","namespace":"default","name":"reverse","className":"reverse.process","runtime":"PYTHON","autoAck":true,"parallelism":1,"source":{"inputSpecs":{"persistent://public/default/backwards":{}}},"sink":{"topic":"persistent://public/default/forwards"},"resources":{}}'
 --pulsar_serviceurl http://localhost:8080/ --use_tls false 
--tls_allow_insecure false --hostname_verification_enabled false 
--max_buffered_tuples 1024 --port 44537 --expected_healthcheck_interval 30
   pulsar_1  | 17:12:13.820 [main] INFO  
org.apache.pulsar.functions.runtime.ProcessRuntime - Started process 
successfully
   pulsar_1  | Traceback (most recent call last):
   pulsar_1  |   File 
"/pulsar/instances/python-instance/python_instance_main.py", line 130, in 
<module>
   pulsar_1  |     main()
   pulsar_1  |   File 
"/pulsar/instances/python-instance/python_instance_main.py", line 119, in main
   pulsar_1  |     pyinstance.run()
   pulsar_1  |   File "/pulsar/instances/python-instance/python_instance.py", 
line 217, in run
   pulsar_1  |     unacked_messages_timeout_ms=int(self.timeout_ms) if 
self.timeout_ms else None
   pulsar_1  |   File "/pulsar/instances/python-instance/pulsar/__init__.py", 
line 497, in subscribe
   pulsar_1  |     conf.read_compacted(is_read_compacted)
   pulsar_1  | AttributeError: 'ConsumerConfiguration' object has no attribute 
'read_compacted'
   pulsar_1  | 17:12:14.107 [main] INFO  
org.apache.pulsar.admin.cli.CmdFunctions - RuntimeSpawner quit because of
   pulsar_1  | 17:12:14.109 [Thread-3] INFO  
org.apache.pulsar.admin.cli.CmdFunctions - Shutting down the localrun 
runtimeSpawner ...
   pulsar_pulsar_1 exited with code 0
   ```
   
   #### Steps to reproduce
   
   Download the Docker image, create a file called `reverse.py` and copy it 
into the image in a custom `Dockerfile`. Use `docker-compose` to start the 
standalone pulsar instance and create a function in `localrun` mode.
   
   #### System configuration
   **Pulsar version**: 2.2.0
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to