phrocker commented on a change in pull request #3647: NIFI-6530 - HTTP
SiteToSite server returns 201 in case no data is ava…
URL: https://github.com/apache/nifi/pull/3647#discussion_r313093647
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/DataTransferResource.java
##########
@@ -205,9 +207,17 @@ public Response createPortTransaction(
final int transportProtocolVersion =
validationResult.transportProtocolVersion;
try {
- // Execute handshake.
- initiateServerProtocol(req, peer, transportProtocolVersion);
+ HttpFlowFileServerProtocol serverProtocol =
initiateServerProtocol(req, peer, transportProtocolVersion);
+ if (PORT_TYPE_OUTPUT.equals(portType)) {
+ List<Connection> connectionList =
serverProtocol.getPort().getIncomingConnections();
+ if (connectionList.stream().allMatch(c ->
c.getFlowFileQueue().isEmpty())) {
+ // Transaction could be created, but there is nothing to
transfer. Just return 200.
+ logger.debug("Output port has no flowfiles to transfer,
returning 200");
Review comment:
We're implying content and a payload. The payload is to say no flow files.
Should we not return a 204?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services