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

[Th2 5143] problem when codec publishes event for book A with attached messages for book B #16

Merged
merged 19 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from 17 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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gradle:7.5-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
51 changes: 30 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HTTP Codec v0.2.0
# HTTP Codec v0.5.0

This microservice can encode and decode HTTP messages

Expand Down Expand Up @@ -27,32 +27,33 @@ This codec processes parsed messages with `http` protocol in metadata field
1. HTTP message - `Message` with `Request` or `Response` type (protocol = `http`)
2. HTTP message body - `RawMessage` with a raw message body (if present)

If decoded message was an HTTP request, message body metadata would contain `method` and `uri` properties with HTTP request method name and URI respectively
If decoded message was an HTTP request, message body metadata would contain `method` and `uri` properties with HTTP
request method name and URI respectively

## Message types

* Request

|Field|Type|Description|
|:---:|:---:|:---:|
|method|String|HTTP method name (e.g. GET, POST, etc.)|
|uri|String|Request URI (e.g. /some/request/path?param1=value1&param2=value2...)|
|headers|List\<Header>|HTTP headers (e.g. Host, Content-Length, etc.)|
| Field | Type | Description |
|:-------:|:-------------:|:--------------------------------------------------------------------:|
| method | String | HTTP method name (e.g. GET, POST, etc.) |
| uri | String | Request URI (e.g. /some/request/path?param1=value1&param2=value2...) |
| headers | List\<Header> | HTTP headers (e.g. Host, Content-Length, etc.) |

* Response

|Field|Type|Description|
|:---:|:---:|:---:|
|statusCode|String|HTTP status code (e.g. 200, 403, 500, etc)|
|reason|String|HTTP status reason (e.g. OK, Forbidden, Internal Server Error, etc.)|
|headers|List\<Header>|HTTP headers (e.g. Set-Cookie, Content-Length, etc.)|
| Field | Type | Description |
|:----------:|:-------------:|:--------------------------------------------------------------------:|
| statusCode | String | HTTP status code (e.g. 200, 403, 500, etc) |
| reason | String | HTTP status reason (e.g. OK, Forbidden, Internal Server Error, etc.) |
| headers | List\<Header> | HTTP headers (e.g. Set-Cookie, Content-Length, etc.) |

* Header

|Field|Type|Description|
|:---:|:---:|:---:|
|name|String|HTTP header name|
|value|String|HTTP header value|
| Field | Type | Description |
|:-----:|:------:|:-----------------:|
| name | String | HTTP header name |
| value | String | HTTP header value |

## Deployment via `infra-mgr`

Expand Down Expand Up @@ -119,16 +120,24 @@ spec:
enabled: false
```

### Gradle metadata note
ignoreGradleMetadataRedirection is used for sonatype because Sailfish dependencies have constrains that interfere with BOM,
so we exclude Gradle metadata for these repositories.
# Release notes

It's been verified that Sailfish itself is compatible with versions from BOM and therefore safe to use.
## 0.5.0

+ Updated common: `5.7.2-dev`
+ Updated common-utils: `2.2.2-dev`
+ Updated codec: `5.4.1-dev`
+ Removed sailfish-utils

# Release notes
## 0.4.0

+ th2 transport protocol support
+ Updated bom:4.4.0
+ Updated common:5.3.0
+ Updated codec:5.3.0

## 0.3.0

* th2-common upgrade to `3.44.0`
* th2-bom upgrade to `4.1.0`
* th2-codec upgrade to `4.7.6`
Expand Down
99 changes: 31 additions & 68 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,8 @@ plugins {
id 'com.palantir.docker' version '0.25.0'
id 'org.jetbrains.kotlin.jvm' version "${kotlin_version}"
id 'application'
id "org.owasp.dependencycheck" version "7.2.0"
id 'org.jetbrains.kotlin.kapt' version "${kotlin_version}"
}

dependencyCheck {
format='HTML'
failBuildOnCVSS=5
}

ext {
sharedDir = file("${project.rootDir}/shared")
sailfishVersion = '3.3.54'
id "org.owasp.dependencycheck" version "8.2.1"
}

group = 'com.exactpro.th2'
Expand All @@ -22,60 +12,19 @@ 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")
}

repositories {
maven {
name 'MavenLocal'
url sharedDir
}

maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
content {
excludeSailfish(it)
}
}

// ignoreGradleMetadataRedirection is used for sonatype because
// Sailfish dependencies have constrains that interfere with our BOM
// so we exclude Gradle metadata for this repositories.
// We've checked these versions - they are compatible and safe to use
mavenCentral()
maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
metadataSources {
mavenPom()
artifact()
ignoreGradleMetadataRedirection()
}
}
maven {
name 'Sonatype_releases'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
content {
excludeSailfish(it)
}
}
maven {
name 'Sonatype_releases'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
metadataSources {
mavenPom()
artifact()
ignoreGradleMetadataRedirection()
}
}
mavenCentral()
mavenLocal()

configurations.all {
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}
Expand All @@ -96,24 +45,21 @@ jar {
}

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

implementation 'com.exactpro.th2:common:5.1.0-dev-version-5+'
implementation 'com.exactpro.th2:codec:5.0.0-dev-version-5+'
implementation "com.exactpro.th2:common:5.7.2-dev"
implementation "com.exactpro.th2:common-utils:2.2.2-dev"
implementation "com.exactpro.th2:codec:5.4.1-dev"

implementation 'com.exactpro.th2:sailfish-utils:3.14.0'

compileOnly 'com.google.auto.service:auto-service:1.0.1'
annotationProcessor '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"

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: '1.7.9'
implementation group: 'com.athaydes.rawhttp', name: 'rawhttp-core', version: '2.4.1'
implementation "io.github.microutils:kotlin-logging:3.0.5"
implementation "com.athaydes.rawhttp:rawhttp-core:2.4.1"

testImplementation group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit5', version: kotlin_version
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
kapt 'com.google.auto.service:auto-service:1.0.1'
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5"
testImplementation "org.junit.jupiter:junit-jupiter:5.10.0"
}

application {
Expand Down Expand Up @@ -149,3 +95,20 @@ compileTestKotlin {
test {
useJUnitPlatform()
}

configurations {
compileClasspath {
resolutionStrategy.activateDependencyLocking()
}
}

dependencyCheck {
formats = ['SARIF', 'JSON', 'HTML']
failBuildOnCVSS = 5
suppressionFile = file('suppressions.xml')
analyzers {
assemblyEnabled = false
nugetconfEnabled = false
nodeEnabled = false
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin_version=1.6.21
release_version=0.3.0
kotlin_version=1.8.22
release_version=0.5.0
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-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Loading
Loading