Hi. Thanks for the report. I will have a look, and report back.
On Tue, Nov 26, 2024 at 12:00 PM <j.allm...@avm.de> wrote: > Hi, > > I am in the process of migrating a project from Nifi 1.26 to Nifi 2.0, and > I am running into problems around the PublishKafka processor. > Since the processor has seen a major redesign, I've had to reconfigure a > couple of things. I was mostly successful, but I noticed my outgoing Kafka > messages are missing their key, which used to be set from a flowfile > attribute ("kafka.key") in 1.26. > > It took me a while to find out how to configure the "Kafka Key" property > of the processor in 2.0, but even after doing so, the key continues to be > null for all my Kafka messages. According to the documentation, "kafka.key" > should be the default attribute to derive the message key from, but neither > setting it explicitly, nor leaving "Kafka Key" empty, nor any other > configuration so far led to anything other than null as the key of my > outgoing Kafka messages. > > I had a quick look into the source code to understand what the processor > actually does, and I came to the conclusion that setting the message key > based on a flowfile attribute requires an impossible to fulfill set of > conditions, more specifically the Publish Strategy being set to "Use > Wrapper" and NOT being set to "Use Wrapper". > > This conclusion might be wrong, since I am not at all familiar with the > Nifi source code. I hope this information still helps diagnosing the > problem, in case it is actually in the source code. > > If the problem is in fact me, mis-configuring the processor, any advice on > how to achieve what 1.26 used to do here is appreciated. > > Best regards > Jonas Allmann >