You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Matthias Küng (Jira)" <ji...@apache.org> on 2025/07/11 08:15:00 UTC

[jira] [Commented] (NIFI-14559) PublishKafka support for primitive key with schema

    [ https://issues.apache.org/jira/browse/NIFI-14559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18004630#comment-18004630 ] 

Matthias Küng commented on NIFI-14559:
--------------------------------------

I guess it's easier to use String keys as a Event design guideline so that generic processing will be easier.

> PublishKafka support for primitive key with schema
> --------------------------------------------------
>
>                 Key: NIFI-14559
>                 URL: https://issues.apache.org/jira/browse/NIFI-14559
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: 2.3.0
>            Reporter: Matthias Küng
>            Priority: Major
>
> For cross domain state topics (compacted) I have the requirement to publish into topics with primitive keys (mainly string, integer or long) which will be consumed with the AvroSerializer.
> Therefore these records have to be published with a Confluent encoded schema reference.
> *Publish Strategy "Use Wrapper"*
> PublishKafka doesn't apply "Record Key Writer" if the key is a primitive. The writer is only called if key is an object with attributes.
> If a writer is set, it should be called in any case to encode the key - no matter whether the key is a primitive value or object.
> *Publish Strategy "Use Content as Record Value"*
> The property "Record Key Writer" should be optionally available and if specified applied to the "Message Key Field" / "Kafka Key"  in the same way as with the "Use Wrapper" strategy.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)