Open dionjansen opened 2 years ago
Pulsar version: 2.10.1
Follow Pulsar functions quickstart. I'm using Docker to run Pulsar standalone:
First, create a new Python file:
$ touch reverse.py
In that file, add the following:
def process(input): return input[::-1]
$ 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
$ docker exec -it pulsar bash -c "bin/pulsar-client consume \ persistent://public/default/forwards \ --subscription-name test \ --num-messages 0"
--forward-source-message-property true
$ 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"
$ 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'"
The consumer in step (2) should output the properties produced.
Instead only the keys __pfn_input_msg_id__ and __pfn_input_topic__ are found in the consumed messages.
__pfn_input_msg_id__
__pfn_input_topic__
----- 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
No response
The issue had no activity for 30 days, mark with Stale label.
Would anyone else be interested in a PR for this?
Search before asking
Version
Pulsar version: 2.10.1
Minimal reproduce step
Follow Pulsar functions quickstart. I'm using Docker to run Pulsar standalone:
1. Run pulsar standalone
First, create a new Python file:
In that file, add the following:
2. Consume results
3. Start the function with
--forward-source-message-property true
(should be default)4. Produce some messages with properties
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.Anything else?
No response
Are you willing to submit a PR?