Skip to content
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

Update dependencies. Add support for transport protocol #15

Open
wants to merge 5 commits into
base: dev-version-2
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
name: Build and publish Docker distributions to Github Container Registry ghcr.io

on:
push:
branches:
- master
- version-*
paths:
- gradle.properties
# - package_info.json
workflow_dispatch:

jobs:
build-job:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
with:
build-target: 'Docker'
docker-username: ${{ github.actor }}
devRelease: true
createTag: true
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}

nvd-api-key: ${{ secrets.NVD_APIKEY }}
15 changes: 15 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build and publish Docker distributions to Github Container Registry ghcr.io

on:
workflow_dispatch:

jobs:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
with:
build-target: 'Docker'
devRelease: false
createTag: true
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ jobs:
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
6 changes: 3 additions & 3 deletions .github/workflows/ci-unwelcome-words.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Checkout tool
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: exactpro-th2/ci-github-action
ref: master
Expand Down
135 changes: 74 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# JSON Codec v2.0.0
# JSON Codec v2.1.0

This microservice can encode and decode JSON messages received via HTTP or any other transport

Expand Down Expand Up @@ -68,74 +68,82 @@ If `messageTypeDetection` is set to `BY_HTTP_METHOD_AND_URI` these messages are
Here's an example of `infra-mgr` config required to deploy this service

```yaml
apiVersion: th2.exactpro.com/v1
apiVersion: th2.exactpro.com/v2
kind: Th2Box
metadata:
name: codec-json
spec:
image-name: ghcr.io/th2-net/th2-codec-json
image-version: 0.7.0
custom-config:
imageName: ghcr.io/th2-net/th2-codec-json
imageVersion: 0.7.0
customConfig:
transportLines:
"":
type: TH2_TRANSPORT
useParentEventId: true
general:
type: TH2_TRANSPORT
useParentEventId: false
codecSettings:
messageTypeDetection: BY_INNER_FIELD
messageTypeField: "messageType"
rejectUnexpectedFields: true
treatSimpleValuesAsStrings: false
dictionaryAlias: ${dictionary_link:dictionary-name}
type: th2-codec
pins:
# encoder
- name: in_codec_encode
connection-type: mq
attributes:
- encoder_in
- subscribe
- group
- name: out_codec_encode
connection-type: mq
attributes:
- encoder_out
- publish
- group
# decoder
- name: in_codec_decode
connection-type: mq
attributes:
- decoder_in
- subscribe
- group
- name: out_codec_decode
connection-type: mq
attributes:
- decoder_out
- publish
- group
# encoder general (technical)
- name: in_codec_general_encode
connection-type: mq
attributes:
- general_encoder_in
- subscribe
- group
- name: out_codec_general_encode
connection-type: mq
attributes:
- general_encoder_out
- publish
- group
# decoder general (technical)
- name: in_codec_general_decode
connection-type: mq
attributes:
- general_decoder_in
- subscribe
- group
- name: out_codec_general_decode
connection-type: mq
attributes:
- general_decoder_out
- publish
- group
extended-settings:
mq:
subscribers:
# encoder
- name: in_codec_encode
connection-type: mq
attributes:
- encoder_in
- subscribe
- transport-group
- name: in_codec_decode
connection-type: mq
attributes:
- decoder_in
- subscribe
- transport-group
- name: in_codec_general_encode
connection-type: mq
attributes:
- general_encoder_in
- subscribe
- transport-group
- name: in_codec_general_decode
connection-type: mq
attributes:
- general_decoder_in
- subscribe
- transport-group
publishers:
- name: out_codec_encode
connection-type: mq
attributes:
- encoder_out
- publish
- transport-group
- name: out_codec_decode
connection-type: mq
attributes:
- decoder_out
- publish
- transport-group
- name: out_codec_general_encode
connection-type: mq
attributes:
- general_encoder_out
- publish
- transport-group
- name: out_codec_general_decode
connection-type: mq
attributes:
- general_decoder_out
- publish
- transport-group
extendedSettings:
service:
enabled: false
```
Expand All @@ -147,15 +155,20 @@ so we exclude Gradle metadata for these repositories.
It's been verified that Sailfish itself is compatible with versions from BOM and therefore safe to use.

## Changelog
### v0.8.0

#### Changed:
### v2.1.0

* Updated versions of common, BOM and sailfish.
+ Add support fot th2 transport

### v2.0.0
+ books&pages support

### v0.8.0

#### Changed:

* Updated versions of common, BOM and sailfish.

### v0.7.0

#### Changed:
Expand Down
85 changes: 15 additions & 70 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,43 +1,29 @@
plugins {
id 'com.palantir.docker' version '0.25.0' apply false
id 'org.jetbrains.kotlin.jvm' version "${kotlin_version}"
id "org.owasp.dependencycheck" version "7.2.0"
id 'org.jetbrains.kotlin.kapt' version "${kotlin_version}"
id 'com.exactpro.th2.gradle.component' version '0.0.8'
}

dependencyCheck {
format='HTML'
failBuildOnCVSS=5
}

apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: 'com.palantir.docker'

ext {
sharedDir = file("${project.rootDir}/shared")
sailfishVersion = '3.3.54'
commonVersion = '5.1.0-dev-version-5+'
sailfishVersion = '3.3.111'
commonVersion = '5.13.1-dev'
}

group = 'com.exactpro.th2'
version = release_version

sourceCompatibility = 11
targetCompatibility = 11

ext.excludeSailfish = { rcd ->
rcd.excludeModule("com.exactpro.sf", "sailfish-core")
rcd.excludeModule("com.exactpro.sf", "sailfish-common")
rcd.excludeModule("com.exactpro.sf", "sailfish-rest-api-client")
rcd.excludeModule("com.exactpro.sf", "service-http")
}

kotlin {
jvmToolchain(11)
}

repositories {
maven {
name 'MavenLocal'
url sharedDir
}

maven {
name 'Sonatype_snapshots'
Expand Down Expand Up @@ -85,42 +71,27 @@ repositories {
}
}

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
)
}
}

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

implementation "com.exactpro.th2:common:${commonVersion}"

implementation 'com.exactpro.th2:codec:5.0.0-dev-version-5+'
implementation 'com.exactpro.th2:sailfish-utils:3.14.0'
implementation 'com.exactpro.th2:codec:5.5.0-dev'
implementation 'com.exactpro.th2:sailfish-utils:4.1.1-dev'

implementation "com.exactpro.sf:service-http:${sailfishVersion}"

implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlin_version
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_version
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: '2.0.10'
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: '3.0.5'

testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.3'
testImplementation group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit5', version: kotlin_version

testImplementation testFixtures("com.exactpro.th2:common:${commonVersion}")

compileOnly 'com.google.auto.service:auto-service:1.0.1'
annotationProcessor 'com.google.auto.service:auto-service:1.0.1'
kapt 'com.google.auto.service:auto-service:1.0.1'
compileOnly 'com.google.auto.service:auto-service:1.1.1'
annotationProcessor 'com.google.auto.service:auto-service:1.1.1'
kapt 'com.google.auto.service:auto-service:1.1.1'
}

test {
Expand All @@ -129,30 +100,4 @@ test {

application {
mainClassName 'com.exactpro.th2.codec.MainKt'
}

applicationName = 'service'

distTar {
archiveName "${applicationName}.tar"
}

dockerPrepare {
dependsOn distTar
}

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

compileKotlin {
kotlinOptions {
jvmTarget = "11"
}
}

compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kotlin.code.style=official

kotlin_version=1.6.21
release_version=2.0.0
kotlin_version=1.8.22
release_version=2.1.0

vcs_url=https://github.com/th2-net/th2-codec-json
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 @@
#Mon May 25 11:22:24 MSK 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Loading
Loading