Skip to content

Commit dda7ccb

Browse files
authored
Merge branch 'master' into use-session-log
2 parents 1279752 + bb2b919 commit dda7ccb

File tree

26 files changed

+384
-44
lines changed

26 files changed

+384
-44
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
java-version: ${{ matrix.java }}
2929
cache: 'maven'
3030
- name: Test with Maven
31-
run: ./mvnw install -B -V -Pminimal-fix-latest -D"java.util.logging.config.file"="logging.properties" -D"http.keepAlive"="false" -D"maven.wagon.http.pool"="false" -D"maven.wagon.httpconnectionManager.ttlSeconds"="120"
31+
run: ./mvnw install -B -V -Pminimal-fix-latest -D"java.util.logging.config.file"="./quickfixj-core/src/test/resources/logging.properties" -D"http.keepAlive"="false" -D"maven.wagon.http.pool"="false" -D"maven.wagon.httpconnectionManager.ttlSeconds"="120"
3232

3333
test-windows:
3434
runs-on: ${{ matrix.os }}
@@ -55,4 +55,4 @@ jobs:
5555
java-version: ${{ matrix.java }}
5656
cache: 'maven'
5757
- name: Test with Maven on Windows
58-
run: ./mvnw.cmd install -B -V -D"maven.javadoc.skip"="true" -P"skipBundlePlugin,minimal-fix-latest" -D"java.util.logging.config.file"="logging.properties" -D"http.keepAlive"="false" -D"maven.wagon.http.pool"="false" -D"maven.wagon.httpconnectionManager.ttlSeconds"="120"
58+
run: ./mvnw.cmd install -B -V -D"maven.javadoc.skip"="true" -P"skipBundlePlugin,minimal-fix-latest" -D"java.util.logging.config.file"="./quickfixj-core/src/test/resources/logging.properties" -D"http.keepAlive"="false" -D"maven.wagon.http.pool"="false" -D"maven.wagon.httpconnectionManager.ttlSeconds"="120"

pom.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6969
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
7070
<jdkLevel>1.8</jdkLevel>
71-
<slf4j.version>2.0.12</slf4j.version>
71+
<slf4j.version>2.0.13</slf4j.version>
7272
<mockito-core.version>4.11.0</mockito-core.version>
7373
<hamcrest.version>2.2</hamcrest.version>
7474
<junit.jupiter.version>5.10.2</junit.jupiter.version>
@@ -79,32 +79,32 @@
7979
<maven-libs-version>3.9.6</maven-libs-version>
8080
<maven-plugin-api-version>3.9.6</maven-plugin-api-version>
8181
<maven-resources-plugin-version>3.3.1</maven-resources-plugin-version>
82-
<maven-compiler-plugin-version>3.12.1</maven-compiler-plugin-version>
83-
<maven-jar-plugin-version>3.3.0</maven-jar-plugin-version>
82+
<maven-compiler-plugin-version>3.13.0</maven-compiler-plugin-version>
83+
<maven-jar-plugin-version>3.4.0</maven-jar-plugin-version>
8484
<maven-surefire-plugin-version>3.2.5</maven-surefire-plugin-version>
8585
<maven-pmd-plugin-version>3.21.2</maven-pmd-plugin-version>
86-
<maven-source-plugin-version>3.3.0</maven-source-plugin-version>
86+
<maven-source-plugin-version>3.3.1</maven-source-plugin-version>
8787
<maven-javadoc-plugin-version>3.6.3</maven-javadoc-plugin-version>
88-
<maven-shade-plugin-version>3.5.1</maven-shade-plugin-version>
89-
<maven-assembly-plugin-version>3.6.0</maven-assembly-plugin-version>
88+
<maven-shade-plugin-version>3.5.2</maven-shade-plugin-version>
89+
<maven-assembly-plugin-version>3.7.1</maven-assembly-plugin-version>
9090
<maven-bundle-plugin-version>5.1.9</maven-bundle-plugin-version>
91-
<maven-gpg-plugin-version>3.1.0</maven-gpg-plugin-version>
91+
<maven-gpg-plugin-version>3.2.3</maven-gpg-plugin-version>
9292
<maven-deploy-plugin-version>3.1.1</maven-deploy-plugin-version>
9393
<nexus-staging-maven-plugin-version>1.6.13</nexus-staging-maven-plugin-version>
9494
<build-helper-maven-plugin-version>3.5.0</build-helper-maven-plugin-version>
9595
<maven-shared-utils.version>3.4.2</maven-shared-utils.version>
9696
<file-management.version>3.0.0</file-management.version>
97-
<maven-plugin-annotations.version>3.11.0</maven-plugin-annotations.version>
97+
<maven-plugin-annotations.version>3.12.0</maven-plugin-annotations.version>
9898
<maven-plugin-testing-harness.version>3.3.0</maven-plugin-testing-harness.version>
9999
<plantuml-maven-plugin-version>1.2</plantuml-maven-plugin-version>
100100
<plantuml-version>8059</plantuml-version>
101101
<xml-maven-plugin-version>1.1.0</xml-maven-plugin-version>
102102
<fix-orchestra.standard.version>1.5.4</fix-orchestra.standard.version>
103103
<fix-orchestra.repository.version>1.7.3</fix-orchestra.repository.version>
104104
<docgen.version>1.6.8</docgen.version>
105-
<jaxb.version>4.0.1</jaxb.version>
105+
<jaxb.version>4.0.2</jaxb.version>
106106
<apache.mina.version>2.2.3</apache.mina.version>
107-
<commons.io.version>2.15.1</commons.io.version>
107+
<commons.io.version>2.16.1</commons.io.version>
108108
<orchestra.file>OrchestraFIXLatest.xml</orchestra.file>
109109
<org.quickfixj.orchestra.tools.version>1.0.2</org.quickfixj.orchestra.tools.version>
110110
<proxool.version>0.9.1</proxool.version>
@@ -224,7 +224,7 @@
224224
<dependency>
225225
<groupId>org.codehaus.plexus</groupId>
226226
<artifactId>plexus-utils</artifactId>
227-
<version>4.0.0</version>
227+
<version>4.0.1</version>
228228
</dependency>
229229
<dependency>
230230
<groupId>org.codehaus.plexus</groupId>
@@ -463,11 +463,11 @@
463463
</plugin>
464464
<plugin>
465465
<artifactId>maven-invoker-plugin</artifactId>
466-
<version>3.6.0</version>
466+
<version>3.6.1</version>
467467
</plugin>
468468
<plugin>
469469
<artifactId>maven-plugin-plugin</artifactId>
470-
<version>3.11.0</version>
470+
<version>3.12.0</version>
471471
</plugin>
472472
<plugin>
473473
<artifactId>maven-install-plugin</artifactId>

quickfixj-base/src/main/java/quickfix/FixVersions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public interface FixVersions {
3030
String BEGINSTRING_FIX44 = "FIX.4.4";
3131

3232
/*
33-
* FIX 5.0+ does not have a begin string.
33+
* FIX 5.0+ does not have a BeginString.
3434
*/
3535
String FIX50 = "FIX.5.0";
3636
String FIX50SP1 = "FIX.5.0SP1";

quickfixj-base/src/main/java/quickfix/InvalidMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
package quickfix;
2121

22-
/*
23-
* An exception when a message is not valid according to the
22+
/**
23+
* Thrown when a message is not valid according to the
2424
* basic message validation or the data dictionary.
2525
*/
2626
public class InvalidMessage extends Exception {

quickfixj-base/src/main/java/quickfix/MessageUtils.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public static Message parse(MessageFactory messageFactory, DataDictionary dataDi
101101
* @param messageFactory
102102
* @param dataDictionary
103103
* @param messageString
104+
* @param validateChecksum
104105
* @return the parsed message
105106
* @throws InvalidMessage
106107
*/
@@ -129,6 +130,10 @@ public static boolean isLogon(String message) {
129130
return isMessageType(message, MsgType.LOGON);
130131
}
131132

133+
public static boolean isLogonMsgType(String msgType) {
134+
return MsgType.LOGON.equals(msgType);
135+
}
136+
132137
private static boolean isMessageType(String message, String msgType) {
133138
try {
134139
return msgType.equals(getMessageType(message));
@@ -208,10 +213,10 @@ public static String getStringField(String messageString, int tag) {
208213
};
209214

210215
/**
211-
* Convert an ApplVerID to a "begin string"
216+
* Convert an ApplVerID to a BeginString.
212217
*
213218
* @param applVerID
214-
* @return the begin string for the specified ApplVerID.
219+
* @return the BeginString for the specified ApplVerID.
215220
* @throws QFJException if conversion fails.
216221
* @see ApplVerID
217222
*/
@@ -239,10 +244,10 @@ public static String toBeginString(ApplVerID applVerID) throws QFJException {
239244
};
240245

241246
/**
242-
* Convert a begin string to an ApplVerID
247+
* Convert a BeginString to an ApplVerID.
243248
*
244249
* @param beginString
245-
* @return the ApplVerID for the specified begin string.
250+
* @return the ApplVerID for the specified BeginString.
246251
* @throws QFJException if conversion fails.
247252
* @see FixVersions
248253
*/

quickfixj-codegenerator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</plugin>
7979
<plugin>
8080
<artifactId>maven-plugin-plugin</artifactId>
81-
<version>3.11.0</version>
81+
<version>3.12.0</version>
8282
<configuration>
8383
<goalPrefix>quickfixj-codegenerator</goalPrefix>
8484
</configuration>

quickfixj-core/src/main/java/quickfix/CachedFileStore.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ public Date getCreationTime() throws IOException {
162162
return cache.getCreationTime();
163163
}
164164

165+
/*
166+
* (non-Javadoc)
167+
* @see quickfix.MessageStore#getCreationTimeCalendar()
168+
*/
169+
public Calendar getCreationTimeCalendar() throws IOException {
170+
return cache.getCreationTimeCalendar();
171+
}
172+
165173
private void initializeSequenceNumbers() throws IOException {
166174
sequenceNumberFile.seek(0);
167175
if (sequenceNumberFile.length() > 0) {

quickfixj-core/src/main/java/quickfix/DefaultSessionSchedule.java

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,17 @@ public class DefaultSessionSchedule implements SessionSchedule {
4141
private final int[] weekdayOffsets;
4242
protected static final Logger LOG = LoggerFactory.getLogger(DefaultSessionSchedule.class);
4343

44+
//Cache recent time data to reduce creation of calendar objects
45+
private final ThreadLocal<Calendar> threadLocalCalendar;
46+
private final ThreadLocal<TimeInterval> threadLocalRecentTimeInterval;
47+
4448
public DefaultSessionSchedule(SessionSettings settings, SessionID sessionID) throws ConfigError,
4549
FieldConvertError {
50+
threadLocalCalendar = ThreadLocal.withInitial(SystemTime::getUtcCalendar);
51+
threadLocalRecentTimeInterval = new ThreadLocal<>();
52+
isNonStopSession = settings.isSetting(sessionID, Session.SETTING_NON_STOP_SESSION)
53+
&& settings.getBool(sessionID, Session.SETTING_NON_STOP_SESSION);
4654

47-
isNonStopSession = settings.isSetting(sessionID, Session.SETTING_NON_STOP_SESSION) && settings.getBool(sessionID, Session.SETTING_NON_STOP_SESSION);
4855
TimeZone defaultTimeZone = getDefaultTimeZone(settings, sessionID);
4956
if (isNonStopSession) {
5057
isWeekdaySession = false;
@@ -104,7 +111,7 @@ private TimeEndPoint getTimeEndPoint(SessionSettings settings, SessionID session
104111
}
105112

106113
private TimeZone getDefaultTimeZone(SessionSettings settings, SessionID sessionID)
107-
throws ConfigError, FieldConvertError {
114+
throws ConfigError {
108115
TimeZone sessionTimeZone;
109116
if (settings.isSetting(sessionID, Session.SETTING_TIMEZONE)) {
110117
String sessionTimeZoneID = settings.getString(sessionID, Session.SETTING_TIMEZONE);
@@ -300,9 +307,16 @@ public boolean isSessionTime() {
300307
if(isNonStopSession()) {
301308
return true;
302309
}
303-
Calendar now = SystemTime.getUtcCalendar();
304-
TimeInterval interval = theMostRecentIntervalBefore(now);
305-
return interval.isContainingTime(now);
310+
Calendar now = threadLocalCalendar.get();
311+
now.setTimeInMillis(SystemTime.currentTimeMillis());
312+
TimeInterval mostRecentInterval = threadLocalRecentTimeInterval.get();
313+
if (mostRecentInterval != null && mostRecentInterval.isContainingTime(now)) {
314+
return true;
315+
}
316+
mostRecentInterval = theMostRecentIntervalBefore(now);
317+
boolean result = mostRecentInterval.isContainingTime(now);
318+
threadLocalRecentTimeInterval.set(mostRecentInterval);
319+
return result;
306320
}
307321

308322
public String toString() {

quickfixj-core/src/main/java/quickfix/FileStore.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ public Date getCreationTime() throws IOException {
152152
return cache.getCreationTime();
153153
}
154154

155+
/* (non-Javadoc)
156+
* @see quickfix.MessageStore#getCreationTimeCalendar()
157+
*/
158+
@Override
159+
public Calendar getCreationTimeCalendar() throws IOException {
160+
return cache.getCreationTimeCalendar();
161+
}
162+
155163
private void initializeSequenceNumbers() throws IOException {
156164
senderSequenceNumberFile.seek(0);
157165
if (senderSequenceNumberFile.length() > 0) {

quickfixj-core/src/main/java/quickfix/JdbcStore.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ public Date getCreationTime() throws IOException {
159159
return cache.getCreationTime();
160160
}
161161

162+
public Calendar getCreationTimeCalendar() throws IOException {
163+
return cache.getCreationTimeCalendar();
164+
}
165+
162166
public int getNextSenderMsgSeqNum() throws IOException {
163167
return cache.getNextSenderMsgSeqNum();
164168
}

0 commit comments

Comments
 (0)