As an add-up to the previous answers, here is a precious resource explaining very clearly how to combine both technologies, and especially why to do so, with illustrated examples.
I found it very valuable and it is a goto reference whenever I need a memory refresher on this topic.
Kafka / NiFi : Better together
In short :
NiFi and Kafka Are Complementary
NiFi
• Provides dataflow solution
• Centralized management, from edge to core
• Great traceability, event level data provenance starting when data is born
• Interactive command and control
• Real time operational visibility
• Dataflow management, including prioritization, back pressure, and edge intelligence
• Visual representation of global dataflow
Kafka
• Provides durable stream store
• Low latency
• Distributed data durability
• Decentralized management of producers & consumers
• And much, much more...