Skip to content

Commit

Permalink
Merge pull request #47 from th2-net/th2-4951
Browse files Browse the repository at this point in the history
[TH2-4951] Set direction in the message. Group by session alias only. Migrate to th2 transport protocol
  • Loading branch information
OptimumCode authored Nov 21, 2023
2 parents 0ea5317 + 70c22d2 commit 559c351
Show file tree
Hide file tree
Showing 16 changed files with 363 additions and 349 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
name: Build and publish Docker distributions to Github Container Registry ghcr.io
name: Dev release build and publish - Docker and Sonatype

on:
workflow_dispatch:
push:
branches:
- dev-version-*
paths:
- gradle.properties
tags:
- \d+.\d+.\d+-dev

jobs:
build-job:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
with:
build-target: 'Docker,Sonatype'
runsOn: ubuntu-latest
gradleVersion: '7'
docker-username: ${{ github.actor }}
devRelease: true
secrets:
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Log Reader User Manual 4.0.1
# Log Reader User Manual 4.1.0

## Document Information

Expand Down Expand Up @@ -28,6 +28,7 @@ spec:
custom-config:
logDirectory: "log/dir"
syncWithCradle: true
useTransport: true
aliases:
A:
regexp: ".*"
Expand Down Expand Up @@ -91,6 +92,7 @@ spec:
+ logDirectory - the directory to watch files
+ syncWithCradle - enables synchronization with Cradle for timestamps and sequences that correspond to the alias
+ useTransport - enables using th2 transport protocol (default value: `false`)
+ aliases - the mapping between alias and files that correspond to that alias
+ pathFilter - filter for files that correspond to that alias
+ regexp - the regular expression to extract data from the source lines
Expand Down Expand Up @@ -192,10 +194,11 @@ logger.<logger_name>.level=<level>
You can use this class to see how the log line is parsed by the read-log.
Use TRACE level to get the information.

**com.exactpro.th2.readlog.impl.RegexpContentParser**
**com.exactpro.th2.readlog.impl.ProtoRegexpContentParser**
**com.exactpro.th2.readlog.impl.TransportRegexpContentParser**

You can use this class to see the resulted lines produced by **_RegexLogParser_**.
Use TRACE level to get the information.
You can use these classes to see the resulted lines produced by **_RegexLogParser_**.
Produce Proto or Transport messages, respectively. Use TRACE level to get the information.

**com.exactpro.th2.read.file.common.AbstractFileReader**

Expand Down Expand Up @@ -224,6 +227,10 @@ Output: 8=FIXT.1.1\u00019=66\u000135=A\u000134=1\u000149=NFT2_FIX1\u000156=FGW\u

## Changes

### 4.1.0

+ Added support for th2 transport protocol

### 4.0.1

+ Added dev-release GitHub workflow
Expand Down Expand Up @@ -296,4 +303,4 @@ Output: 8=FIXT.1.1\u00019=66\u000135=A\u000134=1\u000149=NFT2_FIX1\u000156=FGW\u

### 3.0.0

+ Migrate to a common read-core
+ Migrate to a common read-core
238 changes: 24 additions & 214 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,225 +1,42 @@
/*
* Copyright 2020-2021 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id 'java'
id 'java-library'
id 'application'
id 'maven-publish'
id 'signing'
id 'com.palantir.docker' version '0.25.0'
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
id "org.owasp.dependencycheck" version "8.1.2"
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"

}

group 'com.exactpro.th2'
version release_version

repositories {
mavenCentral()
maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
}
maven {
name 'Sonatype_releases'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
buildscript {
repositories {
gradlePluginPortal()
maven {
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
}
}
mavenLocal()

configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
dependencies {
classpath "com.exactpro.th2:th2-gradle-plugin:0.0.1-dev-5915968839-41381e5-SNAPSHOT"
}
}

apply plugin: "com.exactpro.th2.common-conventions"
apply plugin: "com.exactpro.th2.docker-conventions"
apply plugin: 'kotlin-kapt'

dependencies {
api platform('com.exactpro.th2:bom:4.2.0')
api 'com.exactpro.th2:common:5.2.0'
api 'com.exactpro.th2:read-file-common-core:2.0.0-dev-version-2-4315008828-1ed0f94-SNAPSHOT'
api platform("com.exactpro.th2:bom:4.5.0")
implementation "com.exactpro.th2:common:5.4.2-dev"
implementation "com.exactpro.th2:common-utils:2.2.0-dev"
implementation "com.exactpro.th2:read-file-common-core:3.0.0-dev"

implementation('com.opencsv:opencsv:5.7.0') {
implementation ("com.opencsv:opencsv:5.8") {
because("we need to write a correct CSV in case of free pattern is used")
}

implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation "javax.annotation:javax.annotation-api:1.3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib"

implementation "org.slf4j:slf4j-api"

implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'

testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
testImplementation 'org.mockito:mockito-core:3.6.0'
}

test {
useJUnitPlatform()
testLogging.showStandardStreams = true
}

jar {
manifest {
attributes(
'Created-By': "${System.getProperty('java.version')} (${System.getProperty('java.vendor')})",
'Specification-Title': '',
'Specification-Vendor': 'Exactpro Systems LLC',
'Implementation-Title': project.archivesBaseName,
'Implementation-Vendor': 'Exactpro Systems LLC',
'Implementation-Vendor-Id': 'com.exactpro',
'Implementation-Version': project.version
)
}
}

description = 'DataReaderClient'
sourceCompatibility = JavaVersion.VERSION_11
applicationName = 'service'

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
jvmTarget = "11"
}
}

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

dockerPrepare {
dependsOn distTar
}

docker {
copySpec.from(tarTree("$buildDir/distributions/${applicationName}.tar"))
}

application {
mainClass.set("com.exactpro.th2.readlog.Main")
}

dependencyCheck {
formats=['SARIF']
}

dependencyLocking {
lockAllConfigurations()
}


java {
withJavadocJar()
withSourcesJar()
}

// conditionals for publications
tasks.withType(PublishToMavenRepository) {
onlyIf {
(repository == publishing.repositories.nexusRepository &&
project.hasProperty('nexus_user') &&
project.hasProperty('nexus_password') &&
project.hasProperty('nexus_url')) ||
(repository == publishing.repositories.sonatype &&
project.hasProperty('sonatypeUsername') &&
project.hasProperty('sonatypePassword'))
}
}
tasks.withType(Sign) {
onlyIf { project.hasProperty('signingKey') &&
project.hasProperty('signingPassword')
}
}
// disable running task 'initializeSonatypeStagingRepository' on a gitlab
tasks.whenTaskAdded {task ->
if(task.name.equals('initializeSonatypeStagingRepository') &&
!(project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword'))
) {
task.enabled = false
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = rootProject.name
packaging = 'jar'
description = rootProject.description
url = vcs_url
scm {
url = vcs_url
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'developer'
name = 'developer'
email = '[email protected]'
}
}
scm {
url = vcs_url
}
}
}
}
repositories {
//Nexus repo to publish from gitlab
maven {
name = 'nexusRepository'
credentials {
username = project.findProperty('nexus_user')
password = project.findProperty('nexus_password')
}
url = project.findProperty('nexus_url')
}
}
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}


signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
implementation "com.fasterxml.jackson.core:jackson-databind"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin"
}

test {
useJUnitPlatform {
excludeTags('integration-test')
}
testLogging.showStandardStreams = true
}

tasks.register('integrationTest', Test) {
Expand All @@ -229,13 +46,6 @@ tasks.register('integrationTest', Test) {
}
}

dependencyCheck {
formats=['SARIF', 'JSON', 'HTML']
failBuildOnCVSS=5

analyzers {
assemblyEnabled = false
nugetconfEnabled = false
nodeEnabled = false
}
dependencyLocking {
lockAllConfigurations()
}
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
release_version=4.0.1
vcs_url=https://github.com/th2-net/th2-read-log
release_version=4.1.0
vcs_url=https://github.com/th2-net/th2-read-log
description=DataReaderClient
app_main_class=com.exactpro.th2.readlog.Main
Loading

0 comments on commit 559c351

Please sign in to comment.