Skip to content

Commit 4230d89

Browse files
[TS-1616] Merge pull request #3 from th2-net/TS-1616
2 parents 20f4f82 + 1c6a35c commit 4230d89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5582
-654
lines changed

.github/workflows/build-sanpshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and publish Docker image to Github Container Registry ghcr.io
33
on:
44
push:
55
branches-ignore:
6-
- master
6+
- main
77
- version-*
88
- dependabot**
99
paths-ignore:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gradle:7.1-jdk11 AS build
1+
FROM gradle:7.6-jdk11 AS build
22
ARG release_version
33
COPY ./ .
44
RUN gradle --no-daemon clean build dockerPrepare -Prelease_version=${release_version}

README.md

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# th2-conn-dirty-fix (1.0.0)
1+
# th2-conn-dirty-fix (1.2.0)
22

33
This microservice allows sending and receiving messages via FIX protocol
44

@@ -30,8 +30,9 @@ This microservice allows sending and receiving messages via FIX protocol
3030
+ *senderSubID* - assigned value used to identify specific message originator (desk, trader, etc.)
3131
+ *encryptMethod* - encryption method
3232
+ *username* - user name
33-
+ *password* - user password. FIX client uses the Password(554) tag for unencrypted mode and the EncryptedPassword(1402) tag for encrypted. The encryption is enabled via *passwordEncryptKeyFilePath* option.
34-
+ *newPassword* - user new password. FIX client uses the NewPassword(925) tag for unencrypted mode and the NewEncryptedPassword(1404) tag for encrypted. The encryption is enabled via *passwordEncryptKeyFilePath* option.
33+
+ *password* - user password. FIX client uses the Password(554) tag for unencrypted mode and the EncryptedPassword(1402) tag for encrypted. The encryption is enabled via *passwordEncryptKeyFilePath* option. It is a good practice to pass this variable as kubernetes secret.
34+
+ *newPassword* - user new password. FIX client uses the NewPassword(925) tag for unencrypted mode and the NewEncryptedPassword(1404) tag for encrypted. The encryption is enabled via *passwordEncryptKeyFilePath* option. It is a good practice to pass this variable as kubernetes secret.
35+
+ *previousPasswords* - comma-separated list of passwords used for this user before.
3536
+ *passwordEncryptKeyFilePath* - path to key file for encrypting. FIX client encrypts the *password* value via `RSA` algorithm using specified file if this option is specified.
3637
+ *passwordEncryptKeyFileType* - type of key file content. Supported values: `[PEM_PUBLIC_KEY]`. Default value is `PEM_PUBLIC_KEY`
3738
+ *passwordKeyEncryptAlgorithm* - encrypt algorithm for reading key from file specified in the *passwordEncryptKeyFilePath*. See the KeyFactory section in the [Java Cryptography Architecture Standard Algorithm Name](https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#KeyFactory) for information about standard algorithm names. Default value is `RSA`
@@ -42,10 +43,20 @@ This microservice allows sending and receiving messages via FIX protocol
4243
+ *resetSeqNumFlag* - resetting sequence number in initial Logon message (when conn started)
4344
+ *resetOnLogon* - resetting the sequence number in Logon in other cases (e.g. disconnect)
4445
+ *loadSequencesFromCradle* - defines if sequences will be loaded from cradle to use them in logon message.
46+
+ *loadMissedMessagesFromCradle* - defines how retransmission will be handled. If true, then requested through `ResendRequest` messages (or messages requested on Logon with `NextExpectedSeqNum`) will be loaded from cradle.
4547
+ *sessionStartTime* - UTC time when session starts. (`nullable`)
4648
+ *sessionEndTime* - UTC time when session ends. required if startSessionTime is filled.
49+
+ *sendingDateTimeFormat* - `SendingTime` field format for outgoing messages. (`nullable`, `default format` in this case is `"yyyyMMdd-HH:mm:ss.SSSSSSSSS"`)
4750
+ *useNextExpectedSeqNum* - session management based on next expected sequence number. (`false` by default)
4851
+ *saveAdminMessages* - defines if admin messages will be saved to internal outgoing buffer. (`false` by default)
52+
+ *resetStateOnServerReset* - whether to reset the server sequence after receiving logout with text `Next Expected MSN too high, MSN to be sent is x but received y`.
53+
+ *logoutOnIncorrectServerSequence* - whether to logout session when server send message with sequence number less than expected. If `false` then internal conn sequence will be reset to sequence number from server message.
54+
+ *connectionTimeoutOnSend* - timeout in milliseconds for sending message from queue thread
55+
(please read about [acknowledgment timeout](https://www.rabbitmq.com/consumers.html#acknowledgement-timeout) to understand the problem).
56+
_Default, 30000 mls._ Each failed sending attempt decreases the timeout in half (but not less than _minConnectionTimeoutOnSend_).
57+
The timeout is reset to the original value after a successful sending attempt.
58+
If connection is not established within the specified timeout an error will be reported.
59+
+ *minConnectionTimeoutOnSend* - minimum value for the sending message timeout in milliseconds. _Default value is 1000 mls._
4960

5061
### Security settings
5162

@@ -275,7 +286,7 @@ spec:
275286
- remove: { tag: 110, matches: (.*) }
276287
update-checksum: false
277288
pins:
278-
- name: to_data_provider
289+
- name: to_data_provider
279290
connection-type: grpc-client
280291
service-class: com.exactpro.th2.dataprovider.grpc.DataProviderService
281292
- name: to_send
@@ -325,10 +336,49 @@ spec:
325336

326337
# Changelog
327338

328-
## 1.0.0
339+
## 1.2.0
340+
* Added support for th2 transport protocol
341+
* Header tags are forced to update by conn
342+
* Merged changes from [th2-conn-dirty-fix:1.5.1](https://github.com/th2-net/th2-conn-dirty-fix)
343+
344+
## 1.1.0
345+
* state reset option on server update.
346+
347+
## 1.0.2
348+
* dev releases
349+
* apply changes from version-0
329350

351+
## 1.0.1
352+
* Add bookId to lw data provider query
353+
354+
## 1.0.0
330355
* Bump `conn-dirty-tcp-core` to `3.0.0` for books and pages support
331356

357+
## 0.3.0
358+
* Ability to recover messages from cradle.
359+
360+
## 0.2.0
361+
* optional state reset on silent server reset.
362+
363+
## 0.1.1
364+
* correct sequence numbers increments.
365+
* update conn-dirty-tcp-core to `2.3.0`
366+
367+
## 0.1.0
368+
* correct handling of sequence reset with `endSeqNo = 0`
369+
* Skip messages mangling on error in `demo-fix-mangler` with error event instead of throwing exception.
370+
* allow unconditional rule application
371+
372+
## 0.0.10
373+
* disable reconnect when session is in not-active state.
374+
375+
## 0.0.9
376+
* correct heartbeat and test request handling
377+
378+
## 0.0.8
379+
380+
* th2-common upgrade to `3.44.1`
381+
* th2-bom upgrade to `4.2.0`
332382

333383
## 0.0.7
334384

build.gradle

Lines changed: 84 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
import com.github.jk1.license.filter.LicenseBundleNormalizer
4+
import com.github.jk1.license.render.JsonReportRenderer
5+
16
plugins {
27
id 'java'
3-
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
8+
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
49
id 'com.palantir.docker' version '0.25.0'
10+
id "org.owasp.dependencycheck" version "8.3.1"
11+
id "com.gorylenko.gradle-git-properties" version "2.4.1"
12+
id 'com.github.jk1.dependency-license-report' version '2.5'
13+
id "de.undercouch.download" version "5.4.0"
514
}
615

716
apply plugin: 'application'
@@ -14,15 +23,7 @@ version release_version
1423
sourceCompatibility = 11
1524
targetCompatibility = 11
1625

17-
ext {
18-
sharedDir = file("${project.rootDir}/shared")
19-
}
20-
2126
repositories {
22-
maven {
23-
name 'MavenLocal'
24-
url sharedDir
25-
}
2627
mavenCentral()
2728

2829
maven {
@@ -37,37 +38,45 @@ repositories {
3738

3839
mavenLocal()
3940

40-
configurations.all {
41+
configurations.configureEach {
4142
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
4243
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
4344
}
4445
}
4546

4647
dependencies {
47-
api platform('com.exactpro.th2:bom:4.1.0')
48+
api platform('com.exactpro.th2:bom:4.5.0')
4849

49-
implementation 'com.exactpro.th2:common:5.1.0-dev-version-5-4085018593-8adee33-SNAPSHOT'
50-
implementation 'com.exactpro.th2:netty-bytebuf-utils:0.0.1'
51-
implementation('com.exactpro.th2:conn-dirty-tcp-core:3.0.0-dev-version-3-4184093805-SNAPSHOT') {
52-
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
53-
because 'Projects should use only slf4j-api, without coupling to a certain implementation'
50+
implementation("com.exactpro.th2:common:5.4.0-dev") {
51+
exclude group: 'com.exactpro.th2', module: 'task-utils'
5452
}
55-
implementation 'com.exactpro.th2:grpc-lw-data-provider:2.0.0-dev-version-2-4112857941-SNAPSHOT'
53+
implementation group: 'com.exactpro.th2', name: 'common-utils', version: '2.2.1-dev'
54+
55+
implementation 'com.exactpro.th2:netty-bytebuf-utils:0.0.1'
56+
implementation 'net.lingala.zip4j:zip4j:2.11.5'
57+
implementation 'org.apache.httpcomponents.client5:httpclient5:5.2.1'
58+
59+
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2'
60+
61+
implementation 'com.exactpro.th2:conn-dirty-tcp-core:3.4.0-dev'
62+
implementation 'com.exactpro.th2:grpc-lw-data-provider:2.2.0-dev'
5663

5764
implementation 'org.slf4j:slf4j-api'
58-
implementation 'io.github.microutils:kotlin-logging:2.1.23'
65+
implementation 'io.github.microutils:kotlin-logging:3.0.0' // The last version bases on kotlin 1.6.0
66+
implementation 'org.apache.commons:commons-lang3'
5967

60-
implementation 'io.netty:netty-all:4.1.86.Final'
61-
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21'
68+
implementation 'io.netty:netty-all'
6269
implementation 'com.google.auto.service:auto-service:1.0.1'
6370

64-
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jackson_version
65-
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jackson_version
66-
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: jackson_version
67-
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: jackson_version
71+
implementation 'com.fasterxml.jackson.core:jackson-core'
72+
implementation 'com.fasterxml.jackson.core:jackson-databind'
73+
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
6874

75+
testImplementation 'org.mockito:mockito-core:5.4.0'
6976
testImplementation 'org.mockito:mockito-all:1.10.19'
70-
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5:1.7.10'
77+
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5:1.8.10'
78+
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.3'
79+
testImplementation 'org.mockito.kotlin:mockito-kotlin:4.1.0'
7180

7281
annotationProcessor 'com.google.auto.service:auto-service:1.0.1'
7382
kapt 'com.google.auto.service:auto-service:1.0.1'
@@ -78,13 +87,13 @@ test {
7887
}
7988

8089
application {
81-
mainClassName 'com.exactpro.th2.conn.dirty.tcp.core.Main'
90+
mainClass.set('com.exactpro.th2.conn.dirty.tcp.core.Main')
8291
}
8392

8493
applicationName = 'service'
8594

8695
distTar {
87-
archiveName "${applicationName}.tar"
96+
archiveFileName.set("${applicationName}.tar")
8897
}
8998

9099
dockerPrepare {
@@ -95,14 +104,56 @@ docker {
95104
copySpec.from(tarTree("$buildDir/distributions/${applicationName}.tar"))
96105
}
97106

98-
compileKotlin {
99-
kotlinOptions {
100-
jvmTarget = '11'
107+
tasks.withType(KotlinCompile).configureEach {
108+
compilerOptions {
109+
jvmTarget.set(JvmTarget.JVM_11)
101110
}
102111
}
103112

104-
compileTestKotlin {
105-
kotlinOptions {
106-
jvmTarget = '11'
113+
test {
114+
testLogging {
115+
events "passed", "skipped", "failed"
116+
// You can adjust the logging level as needed
117+
exceptionFormat "full"
118+
showStandardStreams = true
107119
}
108120
}
121+
122+
dependencyCheck {
123+
formats=['SARIF', 'JSON', 'HTML']
124+
failBuildOnCVSS=5
125+
suppressionFile="suppressions.xml"
126+
127+
//FIXME: we should check all used dependencies
128+
skipConfigurations = ['kapt', 'kaptClasspath_kaptKotlin', 'kaptTest', 'kaptTestFixtures', 'annotationProcessor']
129+
analyzers {
130+
assemblyEnabled = false
131+
nugetconfEnabled = false
132+
nodeEnabled = false
133+
}
134+
}
135+
136+
dependencyLocking {
137+
lockAllConfigurations()
138+
}
139+
140+
licenseReport {
141+
def licenseNormalizerBundlePath = "$buildDir/license-normalizer-bundle.json"
142+
143+
if (!file(licenseNormalizerBundlePath).exists()) {
144+
download.run {
145+
src 'https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/license-normalizer-bundle.json'
146+
dest "$buildDir/license-normalizer-bundle.json"
147+
overwrite false
148+
}
149+
}
150+
151+
filters = [
152+
new LicenseBundleNormalizer(licenseNormalizerBundlePath, false)
153+
]
154+
renderers = [
155+
new JsonReportRenderer('licenses.json', false),
156+
]
157+
excludeOwnGroup = false
158+
allowedLicensesFile = new URL("https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/allowed-licenses.json")
159+
}

gradle.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
release_version=1.0.0
2-
jackson_version=2.11.2
1+
release_version=1.2.0

0 commit comments

Comments
 (0)