-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.5.0' into main
- Loading branch information
Showing
277 changed files
with
6,093 additions
and
1,593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.4.0 | ||
0.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
load("//tools/build:springboot.bzl", "springboot") | ||
load("//tools/build:junit5.bzl", "junit5") | ||
load("//tools/build:container_push.bzl", "container_push") | ||
|
||
app_deps = [ | ||
"//backend:base_app", | ||
"//backend/model/message", | ||
"//backend/model/metadata", | ||
"//lib/java/uuid", | ||
"//lib/java/mapping", | ||
"//lib/java/spring/kafka/core:spring-kafka-core", | ||
"//lib/java/spring/kafka/streams:spring-kafka-streams", | ||
"@maven//:io_lettuce_lettuce_core", | ||
"@maven//:org_springframework_data_spring_data_redis", | ||
] | ||
|
||
springboot( | ||
name = "media-resolver", | ||
srcs = glob(["src/main/java/**/*.java"]), | ||
main_class = "co.airy.spring.core.AirySpringBootApplication", | ||
deps = app_deps, | ||
) | ||
|
||
[ | ||
junit5( | ||
size = "medium", | ||
file = file, | ||
resources = glob(["src/test/resources/**/*"]), | ||
deps = [ | ||
":app", | ||
"//backend:base_test", | ||
"//lib/java/kafka/test:kafka-test", | ||
] + app_deps, | ||
) | ||
for file in glob(["src/test/java/**/*Test.java"]) | ||
] | ||
|
||
container_push( | ||
registry = "ghcr.io/airyhq/media", | ||
repository = "resolver", | ||
) |
43 changes: 43 additions & 0 deletions
43
backend/media/src/main/java/co/airy/core/media/Resolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package co.airy.core.media; | ||
|
||
import co.airy.kafka.streams.KafkaStreamsWrapper; | ||
import co.airy.log.AiryLoggerFactory; | ||
import org.apache.kafka.streams.KafkaStreams; | ||
import org.apache.kafka.streams.StreamsBuilder; | ||
import org.slf4j.Logger; | ||
import org.springframework.beans.factory.DisposableBean; | ||
import org.springframework.boot.context.event.ApplicationStartedEvent; | ||
import org.springframework.context.ApplicationListener; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class Resolver implements ApplicationListener<ApplicationStartedEvent>, DisposableBean { | ||
private final Logger log = AiryLoggerFactory.getLogger(Resolver.class); | ||
|
||
private static final String appId = "media.Resolver"; | ||
private final KafkaStreamsWrapper streams; | ||
|
||
public Resolver(KafkaStreamsWrapper streams) { | ||
this.streams = streams; | ||
} | ||
|
||
@Override | ||
public void onApplicationEvent(ApplicationStartedEvent event) { | ||
final StreamsBuilder builder = new StreamsBuilder(); | ||
|
||
streams.start(builder.build(), appId); | ||
} | ||
|
||
@Override | ||
public void destroy() { | ||
if (streams != null) { | ||
streams.close(); | ||
} | ||
} | ||
|
||
|
||
// visible for testing | ||
KafkaStreams.State getStreamState() { | ||
return streams.state(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
kafka.brokers=${KAFKA_BROKERS} | ||
kafka.schema-registry-url=${KAFKA_SCHEMA_REGISTRY_URL} | ||
|
||
storage.host=${STORAGE_HOST} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.