Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Print message when expecting logon #94

Merged
merged 1 commit into from

2 participants

@akisaarinen
Collaborator

In order to make debugging invalid session sequence numbers easier, print out
the whole message when receiving an unexpected message type from the other end.

@akisaarinen akisaarinen fix: Print message when expecting logon
In order to make debugging invalid session sequence numbers easier, print out
the whole message when receiving an unexpected message type from the other end.

Signed-off-by: Aki Saarinen <aki.saarinen@valotrading.com>
4c4c607
@penberg penberg merged commit e89d69c into master
@penberg penberg deleted the features/print-invalid-logon-message branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 21, 2013
  1. @akisaarinen

    fix: Print message when expecting logon

    akisaarinen authored
    In order to make debugging invalid session sequence numbers easier, print out
    the whole message when receiving an unexpected message type from the other end.
    
    Signed-off-by: Aki Saarinen <aki.saarinen@valotrading.com>
This page is out of date. Refresh to see the latest.
View
2  src/main/java/stirling/fix/session/Session.java
@@ -396,7 +396,7 @@ private void process(final Connection conn, Message message, final MessageVisito
}
@Override public void defaultAction(Message message) {
- getLogger().severe("first message is not a logon");
+ getLogger().severe("first message is not a logon: " + message.toString());
logout(conn);
}
});
View
11 src/test/java/stirling/fix/session/LogonSpec.java
@@ -82,13 +82,14 @@ public void invalid() throws Exception {
/* Ref ID 1B: e. Receive any message other than a Logon message. */
public void otherMessageThanLogon() throws Exception {
+ Message message =
+ new MessageBuilder(MsgTypeValue.HEARTBEAT)
+ .msgSeqNum(1)
+ .build();
server.expect(MsgTypeValue.LOGON);
- server.respond(
- new MessageBuilder(MsgTypeValue.HEARTBEAT)
- .msgSeqNum(1)
- .build());
+ server.respond(message);
server.expect(MsgTypeValue.LOGOUT);
- checking(expectLogSevere("first message is not a logon"));
+ checking(expectLogSevere("first message is not a logon: " + message.toString()));
runInClient(new Runnable() {
@Override public void run() {
session.logon(connection);
Something went wrong with that request. Please try again.