dionjansen opened a new issue, #17773:
URL: https://github.com/apache/pulsar/issues/17773

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Version
   
   Pulsar version: 2.10.1
   
   ### Minimal reproduce step
   
   Follow [Pulsar functions 
quickstart](https://github.com/apache/pulsar/blob/master/site2/website/versioned_docs/version-2.3.0/functions-quickstart.md#writing-and-running-a-new-function).
 I'm using Docker to run Pulsar standalone:
   
   ### 1. Run pulsar standalone
   
   First, create a new Python file:
   
   ```bash
   $ touch reverse.py
   ```
   
   In that file, add the following:
   
   ```python
   def process(input):
       return input[::-1]
   ```
   
   ```bash
   $ docker run --name pulsar \
     --rm -it \
     -p 6650:6650 \
     -p 8080:8080 \
     --volume `pwd`/reverse.py:/pulsar/reverse.py \
     apachepulsar/pulsar:2.10.1 bin/pulsar standalone
   ```
   
   ### 2. Consume results
   
   ```bash
   $ docker exec -it pulsar bash -c "bin/pulsar-client consume \
     persistent://public/default/forwards \
     --subscription-name test \
     --num-messages 0"
   ```
   
   ### 3. Start the function with `--forward-source-message-property true` 
(should be default)
   
   ```bash
   $ docker exec -it pulsar bash -c "/pulsar/bin/pulsar-admin functions 
localrun \
     --py '/pulsar/reverse.py' \
     --classname reverse \
     --inputs persistent://public/default/backwards \
     --output persistent://public/default/forwards \
     --tenant public \
     --namespace default \
     --forward-source-message-property true \
     --name reverse"
   ```
   
   ### 4. Produce some messages with properties
   
   ```bash
   $ docker exec -it pulsar bash -c "/pulsar/bin/pulsar-client produce \
     persistent://public/default/backwards \
     --messages '1 tset,2 tset,3 tset' \
     --properties 'foo=bar'"
   ```
   
   
   
   ### What did you expect to see?
   
   The consumer in step (2) should output the properties produced.
   
   ### What did you see instead?
   
   Instead only the keys `__pfn_input_msg_id__` and `__pfn_input_topic__` are 
found in the consumed messages.
   
   ```bash
   ----- got message -----
   key:[null], properties:[__pfn_input_msg_id__=CAwQACAA, 
__pfn_input_topic__=persistent://public/default/backwards], content:test 1
   ----- got message -----
   key:[null], properties:[__pfn_input_msg_id__=CAwQASAA, 
__pfn_input_topic__=persistent://public/default/backwards], content:test 2
   ----- got message -----
   key:[null], properties:[__pfn_input_msg_id__=CAwQAiAA, 
__pfn_input_topic__=persistent://public/default/backwards], content:test 3
   ```
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to