String replySessionID = "FIX.4.2:MARKET->TRADER";
LOG.info("Given the requestSessionID '{}' calculated the replySessionID as '{}'", requestSessionID, replySessionID);
String orderID = exchange.getIn().getHeader("orderID", String.class);
OrderStatusRequest request = new OrderStatusRequest(new ClOrdID("XYZ"), new Symbol("GOOG"), new Side(Side.BUY));
request.set(new OrderID(orderID));
// Look for a reply execution report back to the requester session
// and having the requested OrderID. This is a loose correlation but the best
// we can do with FIX 4.2. Newer versions of FIX have an optional explicit correlation field.
exchange.setProperty(QuickfixjProducer.CORRELATION_CRITERIA_KEY, new MessagePredicate(
new SessionID(replySessionID), MsgType.ORDER_STATUS_REQUEST).withField(OrderID.FIELD, request.getString(OrderID.FIELD)));
exchange.getIn().setBody(request);
}