pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] merlimat commented on a change in pull request #1009: Add optional key/value metadata to producers.
Date Thu, 01 Jan 1970 00:00:00 GMT
merlimat commented on a change in pull request #1009: Add optional key/value metadata to producers.
URL: https://github.com/apache/incubator-pulsar/pull/1009#discussion_r158583882
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/api/ProducerConfiguration.java
 ##########
 @@ -423,6 +427,23 @@ public ProducerConfiguration setInitialSequenceId(long initialSequenceId)
{
         return this;
     }
 
+    /**
+     * Set optional key/value metadata with this producer.
+     * @param key
+     * @param value
+     * @return
+     */
+    public ProducerConfiguration setMetadata(String key, String value) {
+        checkArgument(key != null);
+        checkArgument(value != null);
+        metadata.put(key, value);
+        return this;
+    }
+
+    public Map<String, String> getMetadata() {
 
 Review comment:
   there is `getMetadata()` that returns a map and `setMetadata()` that only sets 1 single
value. 
   
   For that I'd like more the `setProperty()` and `getProperties()`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message