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-5170] Provide a rule to reconfigure send (receive) limit in bytes / sec for specific session. #5

Open
wants to merge 4 commits into
base: main
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
70 changes: 59 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# th2-conn-dirty-fix (1.2.0)
# th2-conn-dirty-fix (1.3.0)

This microservice allows sending and receiving messages via FIX protocol

Expand Down Expand Up @@ -334,7 +334,64 @@ spec:
cpu: 20m
```

# Changelog
# th2-conn-dirty-broken-fix (1.3.0)

## Strategies (Rules)

### Set Rate Limit `SET_RATE_LIMIT`

This strategy ability to temporary change `RateLimit` value for the session.

#### Workflow
1. Stops current session according to `gracefulDisconnect` option
2. Closes and destroys the current channel. This operation is required because `RateLimit` is set on channel level.
3. Creates new channel with rate limit is equal the `setRateLimitConfiguration.rateLimit` option in the rule configuration.
4. Opens the new channel and waits for Logon
5. Does nothing special operations during the strategy activity
6. Stops the new channel and recreates channel with general rate limit

#### Snipped configuration
```yaml
apiVersion: th2.exactpro.com/v1
kind: Th2Box
metadata:
name: fix-client
spec:
image-name: ghcr.io/th2-net/th2-conn-dirty-broken-fix
image-version: 1.3.0
type: th2-conn
custom-config:
maxBatchSize: 1000
maxFlushTime: 1000
batchByGroup: true
publishSentEvents: true
publishConnectEvents: true
sessions:
- sessionAlias: client
handler:
rateLimit: 2147483647
brokenConnConfiguration:
rules:
- ruleType: SET_RATE_LIMIT
cleanUpDuration: 20S
setRateLimitConfiguration:
rateLimit: 10
```

# Changelog (th2-conn-dirty-broken-fix)

## 1.3.0

* Added `SET_RATE_LIMIT` rule.
* Updated common: `5.8.0-dev`
* Updated common-utils: `2.2.2-dev`

## 1.2.1

* Property `th2.broken.strategy` is added to metadata to each message when a strategy is active
* Updated conn-dirty-tcp-core: `3.4.0-dev`

# Changelog (th2-conn-dirty-fix)

## 1.5.1

Expand Down Expand Up @@ -404,18 +461,9 @@ spec:
## 1.0.0
* Bump `conn-dirty-tcp-core` to `3.0.0` for books and pages support

<<<<<<< HEAD
<<<<<<< HEAD
=======
## 0.3.0
* Ability to recover messages from cradle.

>>>>>>> original/dev-version-1
=======
## 0.3.0
* Ability to recover messages from cradle.

>>>>>>> original/dev-version-1
## 0.2.0
* optional state reset on silent server reset.

Expand Down
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ repositories {
dependencies {
api platform('com.exactpro.th2:bom:4.5.0')

implementation("com.exactpro.th2:common:5.4.0-dev") {
implementation("com.exactpro.th2:common:5.8.0-dev") {
exclude group: 'com.exactpro.th2', module: 'task-utils'
}
implementation group: 'com.exactpro.th2', name: 'common-utils', version: '2.2.1-dev'
implementation group: 'com.exactpro.th2', name: 'common-utils', version: '2.2.2-dev'

implementation 'com.exactpro.th2:netty-bytebuf-utils:0.0.1'
implementation 'net.lingala.zip4j:zip4j:2.11.5'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.2.1'

implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2'

implementation 'com.exactpro.th2:conn-dirty-tcp-core:3.3.0-TH2-5001+'
implementation 'com.exactpro.th2:conn-dirty-tcp-core:3.4.0-dev'
implementation 'com.exactpro.th2:grpc-lw-data-provider:2.2.0-dev'

implementation 'org.slf4j:slf4j-api'
Expand All @@ -77,6 +77,7 @@ dependencies {
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5:1.8.10'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.3'
testImplementation 'org.mockito.kotlin:mockito-kotlin:4.1.0'
testImplementation 'org.awaitility:awaitility:4.2.0'

annotationProcessor 'com.google.auto.service:auto-service:1.0.1'
kapt 'com.google.auto.service:auto-service:1.0.1'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version=1.2.0
release_version=1.3.0
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rootProject.name = 'conn-dirty-fix'
rootProject.name = 'conn-dirty-broken-fix'

Loading
Loading