exceptionfactory commented on code in PR #9608:
URL: https://github.com/apache/nifi/pull/9608#discussion_r1904279735


##########
nifi-extension-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/kafka/processors/producer/key/AttributeKeyFactory.java:
##########
@@ -35,7 +36,8 @@ public AttributeKeyFactory(final String keyAttribute,
 
     @Override
     public byte[] getKey(final Map<String, String> attributes, final Record 
record) throws UnsupportedEncodingException {
-        final String keyAttributeValue = (keyAttribute == null) ? null : 
attributes.get(keyAttribute);
+        final String keyAttributeEffective = (keyAttribute == null) ? 
KafkaFlowFileAttribute.KAFKA_KEY : keyAttribute;

Review Comment:
   For clarity, it looks like this logic could be handled in the constructor, 
instead of on every method invocation.



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