You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "exceptionfactory (via GitHub)" <gi...@apache.org> on 2025/01/06 15:18:38 UTC
Re: [PR] NIFI-14117 - PublishKafka should send default attribute as key if cus… [nifi]
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org