Skip to content

[YO-1111] Allow OrigTimestamp field to be ignored #687

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions config/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -1126,4 +1126,17 @@ const (
// - Y
// - N
EnableNextExpectedMsgSeqNum string = "EnableNextExpectedMsgSeqNum"

// CheckOriginalTimestamp if set to Y, the FIX engine will check the OrigSendingTime (tag 122) in the header of incoming messages.
// When enabled, if the OrigSendingTime is not present or the original sending time is later than the SendingTime (tag 52),
// the message will be rejected.
//
// Required: No
//
// Default: Y
//
// Valid Values:
// - Y
// - N
CheckOriginalTimestamp string = "CheckOriginalTimestamp"
)
4 changes: 4 additions & 0 deletions in_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ func (state inSession) doTargetTooLow(session *session, msg *Message, rej target
return logoutState{}
}

if session.SessionSettings.DisableCheckOriginalTimestamp {
return state
}

if !msg.Header.Has(tagOrigSendingTime) {
if err := session.doReject(msg, RequiredTagMissing(tagOrigSendingTime)); err != nil {
return handleStateError(session, err)
Expand Down
2 changes: 2 additions & 0 deletions internal/session_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type SessionSettings struct {
MaxLatency time.Duration
DisableMessagePersist bool

DisableCheckOriginalTimestamp bool

// Required on logon for FIX.T.1 messages.
DefaultApplVerID string

Expand Down
9 changes: 9 additions & 0 deletions session_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ func (f sessionFactory) newSession(
}
}

if settings.HasSetting(config.CheckOriginalTimestamp) {
var checkTimestamp bool
if checkTimestamp, err = settings.BoolSetting(config.CheckOriginalTimestamp); err != nil {
return
}

s.DisableCheckOriginalTimestamp = !checkTimestamp
}

if settings.HasSetting(config.CheckLatency) {
var doCheckLatency bool
if doCheckLatency, err = settings.BoolSetting(config.CheckLatency); err != nil {
Expand Down
Loading