private Action cancelOrder(final Session session) { final Side side = newOrderSingle.sideAsEnum(); newOrderId(); newExecId(); executionReport .execType(ExecType.FILL) .ordStatus(OrdStatus.FILLED) .orderID(ORDER_ID_BUFFER, orderIdEncodedLength) .execID(EXEC_ID_BUFFER, execIdEncodedLength) .side(side); executionReport.instrument().symbol(newOrderSingle.symbol(), newOrderSingle.symbolLength()); return Pressure.apply(session.send(executionReport)); }
private void exchangeExecutionReport() { final ExecutionReportEncoder executionReport = new ExecutionReportEncoder(); executionReport .orderID("order") .execID("exec") .execType(ExecType.FILL) .ordStatus(OrdStatus.FILLED) .side(Side.BUY); executionReport.instrument().symbol("IBM"); assertThat(acceptingSession.send(executionReport), greaterThan(0L)); testSystem.awaitMessageOf(initiatingOtfAcceptor, EXECUTION_REPORT_MESSAGE_AS_STR); }
private Action fillOrder(final Session session) { final Side side = newOrderSingle.sideAsEnum(); newOrderId(); newExecId(); executionReport .orderID(ORDER_ID_BUFFER, orderIdEncodedLength) .execID(EXEC_ID_BUFFER, execIdEncodedLength) .execType(ExecType.FILL) .ordStatus(OrdStatus.FILLED) .side(side); executionReport.instrument().symbol(SYMBOL_BYTES); final long sendPosition = session.send(executionReport); if (Pressure.isBackPressured(sendPosition)) { // Roll back transactional state and indicate that you need to retry. orderId--; execId--; return ABORT; } else { return CONTINUE; } }
public void sendExecutionReport(final int msgSeqNum, final boolean possDupFlag) { final ExecutionReportEncoder executionReportEncoder = new ExecutionReportEncoder(); final HeaderEncoder header = executionReportEncoder.header(); setupHeader(header, msgSeqNum, possDupFlag); executionReportEncoder .orderID("order") .execID("exec") .execType(ExecType.FILL) .ordStatus(OrdStatus.FILLED) .side(Side.BUY); executionReportEncoder.instrument().symbol("IBM"); send(executionReportEncoder); } }