Uh oh!
There was an error while loading. Please reload this page.
allow partition keys when producing messages - #6
Conversation
* ruby doesn't have multiple constructors, so all constructors except the last defined are ignored * change constructor that takes Message to a class method `from_message`
* default for this is "", which is defined in ruby-land so that it can be optional * if its "", it's not added to the message in C++-land
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* move partition_key entirely into Message and out of Producer * allow setting partition_key after message creation * move from_message to ruby-land since it was being finicky in C++
CLAassistant
commented
Mar 18, 2020
rwstauner
commented
May 18, 2020
can we please change to keyword arguments? |
rwstauner
commented
May 21, 2020
I just pushed #9 to demonstrate how simply we can support additional properties (like partition_key) with the keyword arguments constructor. |
atezs82
commented
Dec 9, 2020
@xandroxygen what do you think about @rwstauner's question above? (We want to close or merge PRs in this repo before proceeding with further development.) Thanks! |
xandroxygen
commented
Dec 9, 2020
yep keyword args are great, and since #9 just got merged then I think this can be closed! |
atezs82
commented
Dec 9, 2020
Closing PR, see reasoning above. |
producer.sendis providing the default value for partition_key, I didn't think it was necessary. this is up for discussion :)TODO:
test plan:
export PULSAR_BROKER_URI=pulsar://<your pulsar url and port>bin/consoleproducer = Pulsar::Client.from_environment.create_producer("test")bin/consoleconsumer = Pulsar::Client.from_environment.subscribe("test", "consumer1")msg = consumer.receiveproducer.send("test without key")msg.datais "test without key"msg.partition_keyis the empty stringmsg = consumer.receiveproducer.send("test with key", "the key")msg.datais "test with key"msg.partition_keyis "the key"