Robert created NIFI-13548:
-----------------------------

             Summary: PublishKafkaRecord_2_6 produces negative partition number
                 Key: NIFI-13548
                 URL: https://issues.apache.org/jira/browse/NIFI-13548
             Project: Apache NiFi
          Issue Type: Bug
          Components: Extensions
    Affects Versions: 1.23.2
         Environment: Topic with 20 partitions.
            Reporter: Robert


## Description
 
We've encountered an error in PublishKafkaRecord_2_6 processor. The processor 
fails only for records with value 2147483648 in the message key field. All 
other records can be processed without failure. Million records per day and 
values greater than 2147483648.
 
java.lang.IllegalArgumentException: Invalid partition: -8. Partition number 
should always be non-negative or null.
 
The processor is configured as follows:
 
partitioner class: record path partitioner
partition: /NumericId
Message Key Field: NumericId
 
We tried different reader and writer. Avro with and without schema registry and 
plain json. The result is the same. The inherit schema of the record indicates 
data type long for this field when it reaches the kafka processor.
 
## Steps to Reproduce
 
GenerateFlowFile (with example content) -> ConvertRecord (Json to Avro) -> 
PublishKafkaRecord
 
## Example Record
 
{
"_loadstamp" : "20240711075814350",
"Id" : "04948E4E-94B1-84HD-94CA-AB84020F729",
"NumericId" : 2147483648,
"TimeStamp" : "2024-06-12 15:30:58.341 +02:00",
"SequenceNumber" : 123456789,
"IsTrendUploaded" : false,
"CompoundValueId" : null,
"Value" : 1.0,
"Score" : 65535,
"ScoreColor" : 0,
"CompositeId" : null
}



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

Reply via email to