pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [pulsar] sijie commented on a change in pull request #4015: Allow to configure TypedMessageBuilder through a Map conf object
Date Tue, 09 Apr 2019 23:53:21 GMT
sijie commented on a change in pull request #4015: Allow to configure TypedMessageBuilder through
a Map conf object
URL: https://github.com/apache/pulsar/pull/4015#discussion_r273746876
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/TypedMessageBuilderImpl.java
 ##########
 @@ -130,6 +131,32 @@ public MessageId send() throws PulsarClientException {
         return this;
     }
 
+    @SuppressWarnings("unchecked")
+    @Override
+    public TypedMessageBuilder<T> loadConf(Map<String, Object> config) {
+        config.forEach((key, value) -> {
+            if (key.equals("key")) {
+                this.key(checkType(value, String.class));
+            } else if (key.equals("properties")) {
+                this.properties(checkType(value, Map.class));
+            } else if (key.equals("eventTime")) {
+                this.eventTime(checkType(value, Number.class).longValue());
 
 Review comment:
   but a float or double is also number, right?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message