mirror of https://github.com/apache/nifi.git
NIFI-14006 Fixed Manifest Merger to avoid multiple reads for HTTP Responses (#9518)
- Corrects behavior when running in a cluster required after changes to read from response streams instead of buffering the entire response body in memory Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
919b376c16
commit
6b2dd3209f
|
@ -51,7 +51,7 @@ public class RuntimeManifestEndpointMerger implements EndpointResponseMerger {
|
||||||
final Set<Bundle> responseBundles = responseManifest.getBundles() == null ? new LinkedHashSet<>() : new LinkedHashSet<>(responseManifest.getBundles());
|
final Set<Bundle> responseBundles = responseManifest.getBundles() == null ? new LinkedHashSet<>() : new LinkedHashSet<>(responseManifest.getBundles());
|
||||||
|
|
||||||
for (final NodeResponse nodeResponse : successfulResponses) {
|
for (final NodeResponse nodeResponse : successfulResponses) {
|
||||||
final RuntimeManifestEntity nodeResponseEntity = nodeResponse.getClientResponse().readEntity(RuntimeManifestEntity.class);
|
final RuntimeManifestEntity nodeResponseEntity = nodeResponse == clientResponse ? responseEntity : nodeResponse.getClientResponse().readEntity(RuntimeManifestEntity.class);
|
||||||
final RuntimeManifest nodeResponseManifest = nodeResponseEntity.getRuntimeManifest();
|
final RuntimeManifest nodeResponseManifest = nodeResponseEntity.getRuntimeManifest();
|
||||||
final List<Bundle> nodeResponseBundles = nodeResponseManifest.getBundles() == null ? Collections.emptyList() : nodeResponseManifest.getBundles();
|
final List<Bundle> nodeResponseBundles = nodeResponseManifest.getBundles() == null ? Collections.emptyList() : nodeResponseManifest.getBundles();
|
||||||
responseBundles.retainAll(nodeResponseBundles);
|
responseBundles.retainAll(nodeResponseBundles);
|
||||||
|
|
Loading…
Reference in New Issue