Search code examples
queuejmsapache-nifi

NiFi - JMS acknowledgement after processing


Is it possible to acknowledge a message from JMS using NiFi after processing it?

More specifically, I want to use ConsumeJMS processor to read a message from a queue, process it (using multiple NiFi processors), send it into Kafka using PublishKafka processor and only then send an acknowledgement to JMS. In other words, I do not want to remove the message from the queue before it is committed into Kafka.

I know that there are multiple acknowledgement modes, however none of them seems to do what I need. I aim to achieve similar effect as with HandleHttpRequest and HandleHttpResponse processors, when I am able to send a response after the message is processed.


Solution

  • In most cases like JMS and Kafka, the nifi processor that retrieves the data will write it to NiFi's internal repositories, commit to the internal repositories, and then send the acknowledgement to the source system. So it sends the ack in the source processor after it is guaranteed to be in NiFi.

    There is an effort called NiFi stateless which is more geared to what you described where it can run a linear series of processors and perform any commit/ack until the very end. This effort is fairly new and under development.