sijie commented on a change in pull request #4005: Set key for message when
using function publish
URL: https://github.com/apache/pulsar/pull/4005#discussion_r275099952
##########
File path: pulsar-client-cpp/python/pulsar/functions/context.py
##########
@@ -118,15 +118,43 @@ def get_secret(self, secret_name):
"""Returns the secret value associated with the name. None if nothing was
found"""
pass
+ @abstractmethod
+ def get_partition_key(self):
+ """Returns partition key of the input message is one exists"""
+ pass
+
+
@abstractmethod
def record_metric(self, metric_name, metric_value):
"""Records the metric_value. metric_value has to satisfy
isinstance(metric_value, numbers.Number)"""
pass
@abstractmethod
def publish(self, topic_name, message,
serde_class_name="serde.IdentitySerDe", properties=None, compression_type=None,
callback=None):
+ """
+
+ DEPRECATED
+
+ Publishes message to topic_name by first serializing the message using
serde_class_name serde
+ The message will have properties specified if any
+ """
+ pass
+
+ @abstractmethod
+ def publish(self, topic_name, message,
serde_class_name="serde.IdentitySerDe", compression_type=None, callback=None,
message_conf=None):
Review comment:
I think in python you don't need two methods for backwards compatibility
though. one method with named argument is good enough
----------------------------------------------------------------
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]
With regards,
Apache Git Services