You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/12/05 21:41:49 UTC

[GitHub] erenavsarogullari commented on a change in pull request #3126: [Message Routing] Set CustomPartition implicitly when messageRouter is set

erenavsarogullari commented on a change in pull request #3126: [Message Routing] Set CustomPartition implicitly when messageRouter is set
URL: https://github.com/apache/pulsar/pull/3126#discussion_r239248329
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerBuilderImpl.java
 ##########
 @@ -102,6 +101,11 @@ private ProducerBuilderImpl(PulsarClientImpl client, ProducerConfigurationData c
                     .failedFuture(new IllegalArgumentException("Topic name must be set on the producer builder"));
         }
 
+        if(conf.getCustomMessageRouter() != null
+                && conf.getMessageRoutingMode() != MessageRoutingMode.CustomPartition) {
 
 Review comment:
   Thanks @sijie for the review.
   `messageRoutingMode` is set `RoundRobinPartition` as default so it is **optional**. In the light of this, we can not differentiate the following cases to decide if there is mismatch or not. So, both cases basically set as `RoundRobinPartition`.
   ```
   .messageRouter(new AlwaysTwoMessageRouter())
   ```
   and
   ```
   .messageRoutingMode(MessageRoutingMode.RoundRobinPartition)
   .messageRouter(new AlwaysTwoMessageRouter())
   ```
   Also, `@deprecated ProducerConfiguration.setMessageRouter` is set `messageRoutingMode` **implicitly** for Custom Message Router (can be important to support `backward compatibility`)
   

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