Skip to content

Commit 9ec7547

Browse files
[TH2-5231] Provide ability set limit in bytes for batcher (#36)
* updated workflows * updated dependencies *added `RawMessageBatcher` for th2 transport protocol
1 parent 408b10a commit 9ec7547

File tree

15 files changed

+632
-181
lines changed

15 files changed

+632
-181
lines changed

.github/workflows/dev-release-java-publish-sonatype.yml renamed to .github/workflows/build-dev-release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
name: Build and publish dev-release Java distributions to sonatype.
1+
name: Build and publish dev release jar to sonatype repository
22

3-
on:
4-
push:
5-
tags:
6-
- \d+.\d+.\d+-dev
3+
on: workflow_dispatch
74

85
jobs:
96
build:
107
uses: th2-net/.github/.github/workflows/compound-java.yml@main
118
with:
129
build-target: 'Sonatype'
13-
runsOn: ubuntu-latest
1410
devRelease: true
11+
createTag: true
1512
secrets:
1613
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
1714
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
name: Build and release Java distributions to sonatype.
1+
name: Build and publish release jar to sonatype repository
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
- version-*
8-
paths:
9-
- gradle.properties
3+
on: workflow_dispatch
104

115
jobs:
126
build:
137
uses: th2-net/.github/.github/workflows/compound-java.yml@main
148
with:
159
build-target: 'Sonatype'
16-
runsOn: ubuntu-latest
10+
devRelease: false
11+
createTag: true
1712
secrets:
1813
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
1914
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
2015
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
2116
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
22-
nvd-api-key: ${{ secrets.NVD_APIKEY }}
17+
nvd-api-key: ${{ secrets.NVD_APIKEY }}
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
name: Dev build and publish Java distributions to sonatype snapshot repository
1+
name: Build and publish jar to sonatype snapshot repository
22

33
on:
44
push:
55
branches-ignore:
6-
- master
7-
- version-*
8-
- dependabot*
9-
# paths:
10-
# - gradle.properties
6+
- master
7+
- version-*
8+
- dependabot*
119
paths-ignore:
1210
- README.md
1311

@@ -16,10 +14,9 @@ jobs:
1614
uses: th2-net/.github/.github/workflows/compound-java-dev.yml@main
1715
with:
1816
build-target: 'Sonatype'
19-
runsOn: ubuntu-latest
2017
secrets:
2118
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
2219
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
2320
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
2421
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
25-
nvd-api-key: ${{ secrets.NVD_APIKEY }}
22+
nvd-api-key: ${{ secrets.NVD_APIKEY }}

.github/workflows/ci-unwelcome-words.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ on:
55

66
jobs:
77
test:
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v4
1111
with:
1212
ref: ${{ github.sha }}
1313
- name: Checkout tool
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515
with:
1616
repository: exactpro-th2/ci-github-action
1717
ref: master
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run CI action
2121
uses: ./ci-github-action
2222
with:
23-
ref: ${{ github.sha }}
23+
ref: ${{ github.sha }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gradle:7.6-jdk11 AS build
1+
FROM gradle:8.7-jdk11 AS build
22
ARG release_version
33
ARG bintray_user
44
ARG bintray_key

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# th2 common util library (2.2.3)
1+
# th2 common util library (2.3.0)
22

33
This is th2 java library with useful functions for developers and QA needs.
44

@@ -16,8 +16,30 @@ pending events has reached `maxBatchSize`.
1616
Collects and groups events by their parent-event-id and calls `onBatch` method when `maxFlushTime` for a group has
1717
elapsed or number of events in it has reached `maxBatchSize`.
1818

19+
## message
20+
21+
### Message batcher (th2 transport protocol)
22+
23+
Collects and groups messages by session group and calls `onBatch` method when `maxFlushTime` for a group has
24+
elapsed or number of events in it has reached `maxBatchSize`.
25+
26+
### Raw message batcher (th2 transport protocol)
27+
28+
Collects and groups raw messages by session group and calls `onBatch` method when `maxFlushTime` for a group has
29+
elapsed or number of events in it has reached `maxBatchSize` or batch size in bytes has reached `maxBatchSizeInBytes`.
30+
<br>Note: message batch size calculation logic repeats the logic implemented in [cradle-api:5.4.1-dev](https://github.com/th2-net/cradleapi/tree/5.4.1-dev)
31+
1932
# Changelog
2033

34+
## 2.3.0
35+
36+
* added `RawMessageBatcher` for th2 transport protocol
37+
* updates:
38+
* th2 gradle plugin: `0.1.1`
39+
* bom: `4.6.1`
40+
* common: `5.14.0`
41+
* kotlin-logging: `5.1.4`
42+
2143
## 2.2.3
2244

2345
* fixed: `copyFields` adds nulls if the field does not exist in the source message

build.gradle

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
plugins {
2-
id 'java-library'
32
id 'maven-publish'
43
id 'java-test-fixtures'
54
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
6-
id 'com.exactpro.th2.gradle.publish' version '0.0.5'
5+
id 'com.exactpro.th2.gradle.publish' version '0.1.1'
76
}
87

98
group = 'com.exactpro.th2'
109
version = release_version
1110

1211
ext {
13-
junitVersion = '5.10.0'
12+
junitVersion = '5.11.0'
1413
}
1514

1615
repositories {
@@ -44,24 +43,22 @@ configurations {
4443
}
4544

4645
dependencies {
47-
api 'com.exactpro.th2:grpc-common:4.5.0-dev'
48-
4946
// TODO: Use this dependency util extract th2 transport into separate library
50-
compileOnly("com.exactpro.th2:common:5.10.0-dev") {
47+
compileOnly("com.exactpro.th2:common:5.14.0-dev") {
5148
because("Transport message classes are used in utilities methods")
5249
}
5350

5451
implementation "org.jetbrains:annotations"
5552
implementation "org.slf4j:slf4j-api"
5653

57-
implementation "io.github.microutils:kotlin-logging:3.0.5"
54+
implementation 'io.github.oshai:kotlin-logging:5.1.4'
5855

5956
implementation "io.prometheus:simpleclient"
6057

6158
testImplementation("com.fasterxml.jackson.core:jackson-databind") {
6259
because('provide ability to use object mapper in components')
6360
}
64-
testImplementation "org.mockito.kotlin:mockito-kotlin:5.1.0"
61+
testImplementation "org.mockito.kotlin:mockito-kotlin:5.4.0"
6562
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
6663
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
6764
testFixturesImplementation 'org.jetbrains.kotlin:kotlin-test-junit5'

gradle.properties

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
# Copyright 2023 Exactpro (Exactpro Systems Limited)
2-
# Licensed under the Apache License, Version 2.0 (the "License");
3-
# you may not use this file except in compliance with the License.
4-
# You may obtain a copy of the License at
5-
#
6-
# http://www.apache.org/licenses/LICENSE-2.0
7-
#
8-
# Unless required by applicable law or agreed to in writing, software
9-
# distributed under the License is distributed on an "AS IS" BASIS,
10-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11-
# See the License for the specific language governing permissions and
12-
# limitations under the License.
13-
#
14-
release_version=2.2.3
1+
release_version=2.3.0
152
description='th2 common utils (Java)'
163
vcs_url=https://github.com/th2-net/th2-common-utils-j
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)