pjfanning commented on code in PR #481:
URL: 
https://github.com/apache/incubator-pekko-connectors/pull/481#discussion_r1495484578


##########
solr/src/main/scala/org/apache/pekko/stream/connectors/solr/impl/SolrFlowStage.scala:
##########
@@ -114,8 +113,12 @@ private final class SolrFlowLogic[T, C](
 
       message.routingFieldValue.foreach { routingFieldValue =>
         val routingField = client match {
-          case csc: CloudSolrClient =>
-            Option(csc.getIdField)
+          case csc: CloudSolrClient => {
+            val docCollection = 
Option(csc.getZkStateReader.getCollection(collection))
+            docCollection.flatMap { dc =>
+              Option(dc.getRouter.getRouteField(dc))
+            }

Review Comment:
   The whole point is the worry that this Java code could return null. The use 
of `Option` is deliberate here.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to