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_r275093839
##########
File path:
pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Context.java
##########
@@ -239,9 +239,30 @@
* Publish an object to the topic using default schemas.
*
* @param topicName The name of the topic for publishing
- * @param object The object that needs to be published
+ * @param object The object that needs to be published
* @return A future that completes when the framework is done publishing
the message
*/
<O> CompletableFuture<Void> publish(String topicName, O object);
+ /**
+ * Publish an object using serDe or schema class for serializing to the
topic.
+ *
+ * @param topicName The name of the topic for publishing
+ * @param object The object that needs to be published
+ * @param schemaOrSerdeClassName Either a builtin schema type (eg: "avro",
"json", "protobuf") or the class name
+ * of the custom schema class
+ * @param messageConf A map of configurations to set for the message
that will be published
+ * The available options are:
+ *
+ * "key" - Parition Key
+ * "properties" - Map of properties
+ * "eventTime"
+ * "sequenceId"
+ * "replicationClusters"
+ * "disableReplication"
+ *
+ * @return A future that completes when the framework is done publishing
the message
+ */
+ <O> CompletableFuture<Void> publish(String topicName, O object, String
schemaOrSerdeClassName, Map<String, Object> messageConf);
Review comment:
isn't it better to expose `publish(String topicName, O object, Schema<T>
schema, Map<String, Object> messageConf)`?
----------------------------------------------------------------
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