user6558079
user6558079

Reputation: 31

Logging JSON Payload in Apache NiFi from Java Application POST request

I'm new to Apache NiFi, and I developed an application to send JSON data to a NiFi endpoint via HTTP POST request.

In Apache NiFi, I have a HandleHTTPRequest processor connected to a PutFile processor then a HandleHTTPResponse processor. I've also tried using a LogAttribute processor. The response code and HTTP message from the NiFi web service is working properly, but I'm trying to make sure my JSON payload is being sent properly. Post is enabled in the HTTPRequest handler. Yet, the only files it's generating are blank and 0kb in size. Any ideas?

Upvotes: 3

Views: 1400

Answers (1)

Dennis Jaheruddin
Dennis Jaheruddin

Reputation: 21563

Based on the comments above the conclusion is that there was no problem on the side of Nifi.

It's definitely an issue with the Java code, I used postman again after changing some local firewall configurations and it successfully logs any POST requests that are sent to it and puts it in a file

The key step towards resolving the issue was trying to connect with something like Postman as @Binary Nerd and @Brian Bende suggested.

Upvotes: 0

Related Questions