use of org.openkilda.messaging.info.flow.FlowPathResponse in project open-kilda by telstra.
the class FlowTopologyTest method getPathTopologyEngineBoltTest.
@Test
@Ignore
public void getPathTopologyEngineBoltTest() throws Exception {
ConsumerRecord<String, String> nbRecord;
String flowId = UUID.randomUUID().toString();
PathInfoData payload = pathFlowCommand(flowId);
nbRecord = nbConsumer.pollMessage();
assertNotNull(nbRecord);
assertNotNull(nbRecord.value());
InfoMessage response = objectMapper.readValue(nbRecord.value(), InfoMessage.class);
assertNotNull(response);
FlowPathResponse responseData = (FlowPathResponse) response.getData();
assertNotNull(responseData);
assertEquals(payload, responseData.getPayload());
}
use of org.openkilda.messaging.info.flow.FlowPathResponse in project open-kilda by telstra.
the class FlowServiceImpl method rerouteFlow.
/**
* {@inheritDoc}
*/
@Override
public FlowPathPayload rerouteFlow(String flowId, String correlationId) {
Flow flow = new Flow();
flow.setFlowId(flowId);
FlowRerouteRequest data = new FlowRerouteRequest(flow, FlowOperation.UPDATE);
CommandMessage command = new CommandMessage(data, System.currentTimeMillis(), correlationId, Destination.WFM);
messageConsumer.clear();
messageProducer.send(topic, command);
Message message = (Message) messageConsumer.poll(correlationId);
logger.debug("Got response {}", message);
FlowPathResponse response = (FlowPathResponse) validateInfoMessage(command, message, correlationId);
return Converter.buildFlowPathPayloadByFlowPath(flowId, response.getPayload());
}
Aggregations