fxbing commented on issue #4963: Add more config for auto-topic-creation
URL: https://github.com/apache/pulsar/pull/4963#issuecomment-521877181
 
 
   > @fxbing it is a nice motivation. but I am feeling that you didn't change 
the code in the right place. the change in fetchPartitionedTopicMetadataAsync 
will introduce unnecessary creation of partitioned topic. The `auto-creation` 
happens when a producer or a consumer connects to broker. so I think the change 
should be done in `BrokerService`. You can check the methods `getOrCreateTopic`.
   
   I first thought about making changes in the BrokerService, but when the 
client requests to create a Producer or Consumer, it will first get 
`metedata.partitions`, decide whether to create partitioned or non-partitioned. 
When the request arrives at the BrokerService, the client has decided to create 
a nonpartitioned Producer or Consumer. If the Broker's configuration requires 
automatic creation of a partitioned topic, Broker needs to send the 
configuration information to client, client re-establishes the partitioned 
Producer or Consumer, and the BrokerService updates the partitions in the zk.
   
   I think it's easier to make changes when the client creates the type that 
determines the creation, and need fewer communications.
   
   Do I need to modify it as I said above?
   
   

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


With regards,
Apache Git Services

Reply via email to