}
@Override
public Record onMessage(Record record) {
SynchronousInOutHandler inOutHandler = new SynchronousInOutHandler();
MappedRecord sourceRecord = MappedRecord.class.cast(record);
try {
MappedRecordBindingData bindingData = new MappedRecordBindingData(sourceRecord);
String operation = _selector != null ? _selector.selectOperation(bindingData).getLocalPart() : null;
Exchange exchange = createExchange(operation, inOutHandler);
exchange.send(_composer.compose(bindingData, exchange));
exchange = inOutHandler.waitForOut(_waitTimeout);
MappedRecord returnRecord = _recordFactory.createMappedRecord(_recordName);
returnRecord.setRecordShortDescription(_description);
return _composer.decompose(exchange, new MappedRecordBindingData(returnRecord)).getRecord();
} catch (Exception e) {
throw new SwitchYardException(e);
}
}