abhilashmandaliya commented on a change in pull request #11728:
URL: https://github.com/apache/pulsar/pull/11728#discussion_r693302444



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ProducerConfigurationData.java
##########
@@ -64,6 +64,7 @@
     private int maxPendingMessages = DEFAULT_MAX_PENDING_MESSAGES;
     private int maxPendingMessagesAcrossPartitions = 
DEFAULT_MAX_PENDING_MESSAGES_ACROSS_PARTITIONS;
     private MessageRoutingMode messageRoutingMode = null;
+    private String messageRouterClassName = null;

Review comment:
       @rdhabalia do you mean something like this?
   ```
   public interface MessageRouterFactory {
       MessageRouter get(Properties properties);
   }
   ```
   and while getting message router, we will do something like this:
   ```
   String messageRouterFactoryClassName = 
conf.getMessageRouterFactoryClassName();
   Properties messageRouterFactoryProperties = 
conf.getMessageRouterFactoryProperties();
   clazz = Class.forName(messageRouterFactoryClassName);
   MessageRouterFactory messageRouterFactory = (MessageRouterFactory) 
clazz.getDeclaredConstructor().newInstance();
   messageRouter = messageRouterFactory.get(messageRouterFactoryProperties);
   ```
   
   where `properties` to this factory method will be part of the 
`ProducerConfigurationData` having name like  `messageRouterFactoryProperties` 
of type `java.util.Properties` and `messageRouterClassName` should be renamed 
to `messageRouterFactoryClassName`. This will give more flexibility to the 
users. If you meant something else, can you please share some example snippet?




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