Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send fix message before logging it #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions quickfixj-core/src/main/java/quickfix/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public class Session implements Closeable {

private final Object responderLock = new Object(); // unique instance
// @GuardedBy(responderLock)
private Responder responder;
private volatile Responder responder;

// The session time checks were causing performance problems
// so we are checking only once per second.
Expand Down Expand Up @@ -2512,16 +2512,16 @@ public boolean send(Message message) {
}

private boolean send(String messageString) {
getLog().onOutgoing(messageString);
Responder responder;
synchronized (responderLock) {
responder = this.responder;
}
if (responder == null) {
Responder responder = this.responder;
if(null != responder) {
try {
return responder.send(messageString);
} finally {
getLog().onOutgoing(messageString);
}
} else
getLog().onEvent("No responder, not sending message: " + messageString);
return false;
}
return responder.send(messageString);
return false;
}

private boolean isCorrectCompID(Message message) throws FieldNotFound {
Expand Down