nicoloboschi commented on code in PR #15503:
URL: https://github.com/apache/pulsar/pull/15503#discussion_r874486117


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:
##########
@@ -1464,10 +1466,28 @@ public void createSubscription(
                 throw new RestException(Response.Status.BAD_REQUEST, "Create 
subscription on non-persistent topic "
                         + "can only be done through client");
             }
-            MessageIdImpl messageId = resetCursorData == null ? null :
-                    new MessageIdImpl(resetCursorData.getLedgerId(), 
resetCursorData.getEntryId(),
-                            resetCursorData.getPartitionIndex());
-            internalCreateSubscription(asyncResponse, decode(encodedSubName), 
messageId, authoritative, replicated);
+            MessageIdImpl messageId = null;
+            Map<String, String> subscriptionProperties = null;
+            if (payload != null) {
+                if (payload.containsKey("properties")) {

Review Comment:
   what about creating a class that extends ResetCursorData which contains the 
properties field? 
   the code will look like this:
   
   ```
   class CreateSubscriptionPayload extends ResetCursorData {
     Map<String, String> properties;
   }
   
   if (payload.containsKey("properties")) {
     ObjectMapperFactory.getThreadLocal()
                                           .convertValue(messageIdEncoded, 
CreateSubscriptionPayload.class);
   } else {
     ObjectMapperFactory.getThreadLocal()
                                           .convertValue(messageIdEncoded, 
ResetCursorData.class);
   
   }
   
   
   ```
   
   
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to