Collegues, I am sending NewOrderSingle message to server, server recives message and send response (Execution Report (35=8)):

public void sendOrderMessageToServer( ) throws ConfigError, InterruptedException {

         clientInitiator.start();


        SessionID sessionID = clientInitiator.getSessions().stream()
                .filter(id -> id.getBeginString().equals(BEGINSTRING_FIX44))
                .findFirst()
                .orElseThrow(RuntimeException::new);


        NewOrderSingle newOrderSingle = new NewOrderSingle();

        newOrderSingle.set(new ClOrdID(fixApiCommons.generateClOrdID(newOrderSingle)));
        newOrderSingle.set(new Side(Side.BUY));
        ......
        newOrderSingle.set(new OrdType(OrdType.MARKET));
        newOrderSingle.set(new TimeInForce(TimeInForce.FILL_OR_KILL));


        boolean send = clientQuickFixJTemplate.send(newOrderSingle, sessionID);


        log.info("Result: {}", send);

    }

This method result is true in unit test, but i don’t see server’s response (Execution Report (35=8)) in log.

I have ApplicationListener class:

@Slf4j
@Component
public class ApplicationListener {


    @EventListener
    public void handleCreate(Create create) {
        log.info("onCreate: SessionId={}", create.getSessionId());
    }


    @EventListener
    public void handleLogon(Logon logon) {

        log.info("onLogon: SessionId={}", logon.getSessionId());
    }

    @EventListener
    public void handleLogout(Logout logout) {
        log.info("onLogout: SessionId={}", logout.getSessionId());
    }

    @EventListener
    public void handleToAdmin(ToAdmin toAdmin) {

        try {
            if (toAdmin.getMessage().getHeader().getString(35).equals("A")) {


                toAdmin.getMessage().setString(554, "*******");
                toAdmin.getMessage().setString(141, "Y");

            } 

        } catch (Exception e) {
            e.printStackTrace();
        }

       log.info("toAdmin: SessionId={}", toAdmin.getSessionId());

    }


    @EventListener
    public void handleFromAdmin(FromAdmin fromAdmin) {
        log.info("fromAdmin: Message={}, SessionId={}", fromAdmin.getMessage(), fromAdmin.getSessionId());
    }

    @EventListener
    public void handleToApp(ToApp toApp) {
        log.info("toApp: SessionId={}", toApp.getSessionId());
    }

    @EventListener
public void handleFromApp(FromApp fromApp) {
    log.info("fromApp: Message={}, SessionId={}", fromApp.getMessage(), fromApp.getSessionId());

    try {
                if (fromApp.getMessage().getHeader().getString(35).equals("8")) {
                log.info("It looks we handle ExecutionReport");
//programm doesn't come to this thread =(
            } else {
                log.info("It is not a ExecutionReport message");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}

It writes to console ToAdmin, FromAdmin, toApp, fromApp messages when create session and logon, but it can’t handle response for NewOrderSingle message.

Could you help me how to handle Execution Report (35=8)?

6