use of quickfix.Message in project camel by apache.
the class QuickfixjEngineTest method doLogoffEventsTest.
private void doLogoffEventsTest(SessionID acceptorSessionID, SessionID initiatorSessionID, QuickfixjEngine quickfixjEngine) throws Exception {
final List<EventRecord> events = new ArrayList<EventRecord>();
final CountDownLatch logoffLatch = new CountDownLatch(2);
QuickfixjEventListener logoffListener = new QuickfixjEventListener() {
@Override
public synchronized void onEvent(QuickfixjEventCategory eventCategory, SessionID sessionID, Message message) {
EventRecord event = new EventRecord(eventCategory, sessionID, message);
events.add(event);
if (eventCategory == QuickfixjEventCategory.SessionLogoff) {
logoffLatch.countDown();
}
}
};
quickfixjEngine.addEventListener(logoffListener);
quickfixjEngine.stop();
assertTrue("Logoffs not received", logoffLatch.await(5000, TimeUnit.MILLISECONDS));
quickfixjEngine.removeEventListener(logoffListener);
assertThat(events.size(), is(2));
assertTrue(events.contains(new EventRecord(QuickfixjEventCategory.SessionLogoff, acceptorSessionID, null)));
assertTrue(events.contains(new EventRecord(QuickfixjEventCategory.SessionLogoff, initiatorSessionID, null)));
}
use of quickfix.Message in project camel by apache.
the class FixMessageRouter method route.
public String route(Exchange exchange) {
Message message = exchange.getIn().getBody(Message.class);
if (message != null) {
SessionID destinationSession = getDestinationSessionID(message);
if (destinationSession != null) {
String destinationUri = String.format("%s?sessionID=%s", engineUri, destinationSession);
LOG.debug("Routing destination: {}", destinationUri);
return destinationUri;
}
}
return null;
}
Aggregations