mirror of https://github.com/apache/nifi.git
NIFI-5078 - added source/destination connection info in S2SStatusRT
Signed-off-by: Matthew Burgess <mattyb149@apache.org> This closes #2632
This commit is contained in:
parent
c575a98936
commit
262bf011e4
|
@ -339,6 +339,10 @@ public class SiteToSiteStatusReportingTask extends AbstractSiteToSiteReportingTa
|
|||
componentType, componentName);
|
||||
|
||||
addField(builder, "componentId", status.getId());
|
||||
addField(builder, "sourceId", status.getSourceId());
|
||||
addField(builder, "sourceName", status.getSourceName());
|
||||
addField(builder, "destinationId", status.getDestinationId());
|
||||
addField(builder, "destinationName", status.getDestinationName());
|
||||
addField(builder, "maxQueuedBytes", status.getMaxQueuedBytes());
|
||||
addField(builder, "maxQueuedCount", status.getMaxQueuedCount());
|
||||
addField(builder, "queuedBytes", status.getQueuedBytes());
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.util.Map;
|
|||
import java.util.UUID;
|
||||
|
||||
import javax.json.Json;
|
||||
import javax.json.JsonObject;
|
||||
import javax.json.JsonReader;
|
||||
import javax.json.JsonString;
|
||||
|
||||
|
@ -144,8 +145,11 @@ public class TestSiteToSiteStatusReportingTask {
|
|||
|
||||
final String msg = new String(task.dataSent.get(0), StandardCharsets.UTF_8);
|
||||
JsonReader jsonReader = Json.createReader(new ByteArrayInputStream(msg.getBytes()));
|
||||
JsonString backpressure = jsonReader.readArray().getJsonObject(0).getJsonString("isBackPressureEnabled");
|
||||
JsonObject object = jsonReader.readArray().getJsonObject(0);
|
||||
JsonString backpressure = object.getJsonString("isBackPressureEnabled");
|
||||
JsonString source = object.getJsonString("sourceName");
|
||||
assertEquals("true", backpressure.getString());
|
||||
assertEquals("source", source.getString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -318,6 +322,10 @@ public class TestSiteToSiteStatusReportingTask {
|
|||
cStatus.setOutputCount(7);
|
||||
cStatus.setQueuedBytes(8l);
|
||||
cStatus.setQueuedCount(9);
|
||||
cStatus.setSourceId(id);
|
||||
cStatus.setSourceName("source");
|
||||
cStatus.setDestinationId(id);
|
||||
cStatus.setDestinationName("destination");
|
||||
|
||||
return cStatus;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue