Skip to content
Merged
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
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Maven Central](https://maven-badges.sml.io/sonatype-central/ru.tinkoff.kora/common/badge.svg)](https://maven-badges.sml.io/sonatype-central/ru.tinkoff.kora/common)
[![Maven Central](https://img.shields.io/maven-central/v/ru.tinkoff.kora/common.svg)](https://central.sonatype.com/artifact/ru.tinkoff.kora/common)
[![GitHub Action](https://github.com/kora-projects/kora-examples/workflows/Build%20Master/badge.svg)](https://github.com/kora-projects/kora-examples/actions?query=workflow%3A%22Build%20Master%22++)

# Kora examples
Expand All @@ -10,11 +10,15 @@
использовать примеры как пособие по начальному погружению в Kora.
[Хотите знать больше?](https://kora-projects.github.io/kora-docs/ru/)

[Описание](https://kora-projects.github.io/kora-docs/ru/) | [Документация](https://kora-projects.github.io/kora-docs/ru/documentation/general/) | [Ознакомление](https://kora-projects.github.io/kora-docs/ru/examples/hello-world/)

---

This repository contains examples of applications using various [Kora framework](https://kora-projects.github.io/kora-docs/en/) fmodules.
This repository contains examples of applications using various [Kora framework](https://kora-projects.github.io/kora-docs/en/) modules.
Each Gradle module is an independent application.

Here you can look at implementations of Kora framework modules in Java and Kotlin languages, test their functionality,
use the examples as a guide for initial immersion in Kora.
[Would you like to know more?](https://kora-projects.github.io/kora-docs/en/)
[Would you like to know more?](https://kora-projects.github.io/kora-docs/en/)

[Home](https://kora-projects.github.io/kora-docs/en/) | [Documentation](https://kora-projects.github.io/kora-docs/en/documentation/general/) | [Hello World](https://kora-projects.github.io/kora-docs/en/examples/hello-world/)
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
groupId=ru.tinkoff.kora
koraVersion=1.2.0
koraVersion=1.2.2


##### GRADLE #####
Expand Down
6 changes: 4 additions & 2 deletions kora-java-s3-client-aws/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ dependencies {
implementation "ru.tinkoff.kora.experimental:s3-client-aws"
implementation "ru.tinkoff.kora:http-client-async"
implementation "ru.tinkoff.kora:http-client-jdk"
implementation "ru.tinkoff.kora:http-client-ok"

implementation "ru.tinkoff.kora:logging-logback"
implementation "ru.tinkoff.kora:config-hocon"
Expand All @@ -43,7 +42,10 @@ application {
//noinspection GroovyAssignabilityCheck
run {
environment([
"": ""
"S3_URL" : "$s3Url",
"S3_BUCKET" : "$s3Bucket",
"S3_ACCESS_KEY": "$s3AccessKey",
"S3_SECRET_KEY": "$s3SecretKey",
])
}

Expand Down
15 changes: 15 additions & 0 deletions kora-java-s3-client-aws/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
minio:
image: docker-proxy.artifactory.tcsbank.ru/minio/minio:RELEASE.2025-04-22T22-12-26Z
restart: unless-stopped
ports:
- '9000:9000'
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
command: server /data/minio
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
5 changes: 5 additions & 0 deletions kora-java-s3-client-aws/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
##### S3 #####
s3Url=http://localhost:9000
s3Bucket=minio
s3AccessKey=minio
s3SecretKey=minio123
5 changes: 4 additions & 1 deletion kora-java-s3-client-minio/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ application {
//noinspection GroovyAssignabilityCheck
run {
environment([
"": ""
"S3_URL" : "$s3Url",
"S3_BUCKET" : "$s3Bucket",
"S3_ACCESS_KEY": "$s3AccessKey",
"S3_SECRET_KEY": "$s3SecretKey",
])
}

Expand Down
15 changes: 15 additions & 0 deletions kora-java-s3-client-minio/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
minio:
image: docker-proxy.artifactory.tcsbank.ru/minio/minio:RELEASE.2025-04-22T22-12-26Z
restart: unless-stopped
ports:
- '9000:9000'
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
command: server /data/minio
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
5 changes: 5 additions & 0 deletions kora-java-s3-client-minio/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
##### S3 #####
s3Url=http://localhost:9000
s3Bucket=minio
s3AccessKey=minio
s3SecretKey=minio123
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,23 @@ class TelemetryTests {
void tracingTelemetryExported() throws Exception {
// given
var httpClient = HttpClient.newHttpClient();

// when
var requestTest = HttpRequest.newBuilder()
.GET()
.uri(container.getURI().resolve("/text"))
.timeout(Duration.ofSeconds(5))
.build();

// when
var responseTest = httpClient.send(requestTest, HttpResponse.BodyHandlers.ofString());
assertEquals(200, responseTest.statusCode());

// then
Awaitility.await().atMost(Duration.ofSeconds(5))
.untilAsserted(() -> {
.until(() -> {
final String logs = telemetryContainer.getLogs(OutputFrame.OutputType.STDERR);
final String[] logsSplit = logs.split("\n");
final String lastLog = logsSplit[logsSplit.length - 1].replace('\t', ' ');
lastLog.endsWith(
return lastLog.endsWith(
"TracesExporter {\"kind\": \"exporter\", \"data_type\": \"traces\", \"name\": \"logging\", \"#spans\": 1}");
});
}
Expand All @@ -58,14 +57,13 @@ void tracingTelemetryExported() throws Exception {
void healthLivenessFails() throws Exception {
// given
var httpClient = HttpClient.newHttpClient();

// then
var request = HttpRequest.newBuilder()
.GET()
.uri(container.getSystemURI().resolve("/liveness"))
.timeout(Duration.ofSeconds(5))
.build();

// then
var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
assertEquals(503, response.statusCode());
assertEquals("Error", response.body());
Expand All @@ -75,14 +73,13 @@ void healthLivenessFails() throws Exception {
void healthReadinessFails() throws Exception {
// given
var httpClient = HttpClient.newHttpClient();

// then
var request = HttpRequest.newBuilder()
.GET()
.uri(container.getSystemURI().resolve("/readiness"))
.timeout(Duration.ofSeconds(5))
.build();

// then
var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
assertEquals(503, response.statusCode());
assertEquals("Error", response.body());
Expand All @@ -92,14 +89,13 @@ void healthReadinessFails() throws Exception {
void metricsSuccess() throws Exception {
// given
var httpClient = HttpClient.newHttpClient();

// then
var request = HttpRequest.newBuilder()
.GET()
.uri(container.getSystemURI().resolve("/metrics"))
.timeout(Duration.ofSeconds(5))
.build();

// then
var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
assertEquals(200, response.statusCode());
assertFalse(response.body().isBlank());
Expand Down
Loading