We noticed an issue with the HandleHTTPResponse processor in which the processor sends the response but it also sends the body of the message along with the response. We wanted to ask if it was possible for future development to add a configuration in the processor that allows the option of sending the response without the body of the message, since this can affect the time that it takes for the client to receive the response from us, because NiFi is sending the full message again, along with the response. As of now we have been unable to find an optimal solution that does not impact our flow performance in regards with removing the body of the message and only sending the response. We wanted to see if this could be a configuration that Hortonworks could look into for this processor, since we think it would be a useful one that could provide positive impact on the response time of the NiFi’s HandleHTTPResponse processor.
Consider opening an Apache Jira for this enhancement. Until then, did you try using ReplaceText to strip out body of a msg?
@Artem Ervits , I did try to use Replace Text processor to remove the body of the message, the problem is that the way the flow needs to be structure is that after sending a 200 positive response from the HandleHTTPResponse processor to the client, the content of the message needs to be routed to different kafka topics. The problem is that this routing to kafka needs to be done only if the message gave a 200 response, else the message needs to terminate there because it gave a bad response and the client needs to resend the message. Because of this procedure the body of the message is needed for processing purposes after giving the 200 response, I am just looking for a way to keep the content of the message but only send to the client the response without that content. I tried sending the content to both our HandleHTTPResponse processor and to a MergeContent processor and then trigger the MergeContent processor after the content was removed from the body of the message using the ReplaceText processor or the ModifyBit processor and then send the response, and if the response was successful then trigger the MergeContent processor, however this is still not working as well as I need it. Because of this I suggested the addition of a new configuration in the HandleHTTPResponse processor, in order to have an option that allows to choose if you want the response to be sent with the content of the message or without it, without affecting the content of the message itself so that it can be used directly in the rest of the flow for other purposes without the hassle of adding a bunch of different processors to the flow.