Skip to content

Commit

Permalink
Merge pull request #43 from th2-net/TH2-4912
Browse files Browse the repository at this point in the history
[TH2-4912] Migrate to transport protocol. Update inside logic
  • Loading branch information
OptimumCode authored Oct 13, 2023
2 parents 6f8d220 + 20689ec commit 27c30e2
Show file tree
Hide file tree
Showing 15 changed files with 370 additions and 143 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gradle:7.1-jdk11 AS build
FROM gradle:7.6-jdk11 AS build
ARG release_version
COPY ./ .
RUN gradle --no-daemon clean build dockerPrepare -Prelease_version=${release_version}
Expand Down
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# th2-conn-dirty-fix (1.4.1)
# th2-conn-dirty-fix (1.4.2)

This microservice allows sending and receiving messages via FIX protocol

Expand Down Expand Up @@ -50,6 +50,10 @@ This microservice allows sending and receiving messages via FIX protocol
+ *saveAdminMessages* - defines if admin messages will be saved to internal outgoing buffer. (`false` by default)
+ *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`.
+ *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.
+ *connectionTimeoutOnSend* - timeout in milliseconds for sending message from queue thread
(please read about [acknowledgment timeout](https://www.rabbitmq.com/consumers.html#acknowledgement-timeout) to understand the problem).
_Default, 30000 mls._
If connection is not established within the specified timeout an error will be reported.

### Security settings

Expand Down Expand Up @@ -328,24 +332,38 @@ spec:
```

# Changelog
### 1.4.1
* Use UTC time zone for sending time tag

### 1.4.0
## 1.4.2
* Ungraceful session disconnect support.
* Removed NPE when session is reset by schedule.
* Use UTC time zone for sending time tag

## 1.4.1
* Timeout on send from queue thread
* Parameter `connectionTimeoutOnSend` was added

### 1.3.2
## 1.4.0
* Updated bom: `4.5.0-dev`
* Updated common: `5.4.0-dev`
* Updated common-utils: `2.2.0-dev`
* Updated grpc-lw-data-provider: `2.1.0-dev`
* Updated kotlin: `1.8.22`
* Added support for th2 transport protocol

## 1.3.2
* Improve logging: log session group and session alias for each log message.

# 1.3.1
## 1.3.1
* fix multiple consequent SOH characters

## 1.3.0
* Added handling for incoming test request messages
* Fixed resetSeqNum flag handling on incoming logon messages.
* Added option to automatically reset server sequence when internal conn sequence doesn't match with sequence that server sent.

## 1.2.1
* fix multiple consequent SOH characters

## 1.2.0
* loading requested messages from cradle.

Expand Down
85 changes: 50 additions & 35 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.JsonReportRenderer

plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
id 'com.palantir.docker' version '0.25.0'
id "org.owasp.dependencycheck" version "8.2.1"
id "org.owasp.dependencycheck" version "8.3.1"
id "com.gorylenko.gradle-git-properties" version "2.4.1"
id 'com.github.jk1.dependency-license-report' version '2.5'
id "de.undercouch.download" version "5.4.0"
}

apply plugin: 'application'
Expand All @@ -16,15 +23,7 @@ version release_version
sourceCompatibility = 11
targetCompatibility = 11

ext {
sharedDir = file("${project.rootDir}/shared")
}

repositories {
maven {
name 'MavenLocal'
url sharedDir
}
mavenCentral()

maven {
Expand All @@ -39,34 +38,33 @@ repositories {

mavenLocal()

configurations.all {
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}
}

dependencies {
api platform('com.exactpro.th2:bom:4.4.0')
api platform('com.exactpro.th2:bom:4.5.0')

implementation 'com.exactpro.th2:common:5.2.2-dev'
implementation 'com.exactpro.th2:netty-bytebuf-utils:0.0.1'
implementation('com.exactpro.th2:conn-dirty-tcp-core:3.0.0-dev') {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
because 'Projects should use only slf4j-api, without coupling to a certain implementation'
implementation("com.exactpro.th2:common:5.4.0-dev") {
exclude group: 'com.exactpro.th2', module: 'task-utils'
}
implementation 'com.exactpro.th2:grpc-lw-data-provider:2.0.0-dev-version-2-4112857941-SNAPSHOT'
implementation "com.exactpro.th2:common-utils:2.2.0-dev"
implementation 'com.exactpro.th2:netty-bytebuf-utils:0.0.1'
implementation 'com.exactpro.th2:conn-dirty-tcp-core:3.2.1-dev'
implementation 'com.exactpro.th2:grpc-lw-data-provider:2.2.0-dev'

implementation 'org.slf4j:slf4j-api'
implementation 'io.github.microutils:kotlin-logging:2.1.23'
implementation 'org.apache.commons:commons-lang3:3.13.0'
implementation 'io.github.microutils:kotlin-logging:3.0.0' // The last version bases on kotlin 1.6.0
implementation 'org.apache.commons:commons-lang3'

implementation 'io.netty:netty-all'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21'
implementation 'com.google.auto.service:auto-service:1.0.1'

implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jackson_version
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jackson_version
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: jackson_version
implementation 'com.fasterxml.jackson.core:jackson-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'

testImplementation 'org.mockito:mockito-all:1.10.19'
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5:1.7.10'
Expand All @@ -80,13 +78,13 @@ test {
}

application {
mainClassName 'com.exactpro.th2.conn.dirty.tcp.core.Main'
mainClass.set('com.exactpro.th2.conn.dirty.tcp.core.Main')
}

applicationName = 'service'

distTar {
archiveName "${applicationName}.tar"
archiveFileName.set("${applicationName}.tar")
}

dockerPrepare {
Expand All @@ -97,15 +95,9 @@ docker {
copySpec.from(tarTree("$buildDir/distributions/${applicationName}.tar"))
}

compileKotlin {
kotlinOptions {
jvmTarget = '11'
}
}

compileTestKotlin {
kotlinOptions {
jvmTarget = '11'
tasks.withType(KotlinCompile).configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}

Expand All @@ -114,6 +106,8 @@ dependencyCheck {
failBuildOnCVSS=5
suppressionFile="suppressions.xml"

//FIXME: we should check all used dependencies
skipConfigurations = ['kapt', 'kaptClasspath_kaptKotlin', 'kaptTest', 'kaptTestFixtures', 'annotationProcessor']
analyzers {
assemblyEnabled = false
nugetconfEnabled = false
Expand All @@ -124,3 +118,24 @@ dependencyCheck {
dependencyLocking {
lockAllConfigurations()
}

licenseReport {
def licenseNormalizerBundlePath = "$buildDir/license-normalizer-bundle.json"

if (!file(licenseNormalizerBundlePath).exists()) {
download.run {
src 'https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/license-normalizer-bundle.json'
dest "$buildDir/license-normalizer-bundle.json"
overwrite false
}
}

filters = [
new LicenseBundleNormalizer(licenseNormalizerBundlePath, false)
]
renderers = [
new JsonReportRenderer('licenses.json', false),
]
excludeOwnGroup = false
allowedLicensesFile = new URL("https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/allowed-licenses.json")
}
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
release_version=1.4.1
jackson_version=2.11.2

release_version=1.4.2
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 27c30e2

Please sign in to comment.