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

Fix schemaregistry #376

Merged
merged 1 commit into from
Jun 10, 2024
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
12 changes: 9 additions & 3 deletions java-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ val githubIssueUrl = "https://github.com/$githubRepoName/issues"
subprojects {
apply(plugin = "org.radarbase.radar-kotlin")

repositories{
mavenCentral()
gradlePluginPortal()
maven(url = "https://jitpack.io")
}

radarKotlin {
javaVersion.set(Versions.java)
kotlinVersion.set(Versions.kotlin)
Expand Down Expand Up @@ -64,9 +70,9 @@ configure(listOf(
githubUrl.set("https://github.com/$githubRepoName")
developers {
developer {
id.set("blootsvoets")
name.set("Joris Borgdorff")
email.set("joris@thehyve.nl")
id.set("bdegraaf1234")
name.set("Bastiaan de Graaf")
email.set("bastiaan@thehyve.nl")
organization.set("The Hyve")
}
developer {
Expand Down
2 changes: 1 addition & 1 deletion java-sdk/buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ object Versions {
const val java = 17
const val avroGenerator = "1.9.1"

const val radarCommons = "1.1.2"
const val radarCommons = "1.1.3-SNAPSHOT"
const val avro = "1.11.3"
const val jackson = "2.16.1"
const val argparse = "0.9.0"
Expand Down
4 changes: 0 additions & 4 deletions java-sdk/radar-schemas-registration/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
description = "RADAR Schemas specification and validation tools"

repositories {
maven(url = "https://jitpack.io")
}

dependencies {
api(project(":radar-schemas-commons"))
api(project(":radar-schemas-core"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.radarbase.schema.registration

import io.ktor.client.HttpClient
import io.ktor.client.engine.cio.CIO
import io.ktor.client.plugins.auth.Auth
import io.ktor.client.plugins.auth.providers.BasicAuthCredentials
import io.ktor.client.plugins.auth.providers.basic
Expand Down Expand Up @@ -44,6 +46,7 @@ import org.radarcns.kafka.ObservationKey
import org.slf4j.LoggerFactory
import java.io.IOException
import java.net.MalformedURLException
import java.net.URI
import java.time.Duration
import kotlin.streams.asSequence
import kotlin.time.Duration.Companion.seconds
Expand All @@ -62,7 +65,7 @@ class SchemaRegistry(
private val topicConfiguration: Map<String, TopicConfig> = emptyMap(),
) {
private val schemaClient: SchemaRetriever = schemaRetriever(baseUrl) {
httpClient {
httpClient = HttpClient(CIO) {
timeout(10.seconds)
if (apiKey != null && apiSecret != null) {
install(Auth) {
Expand Down Expand Up @@ -94,7 +97,7 @@ class SchemaRegistry(
.mapNotNull {
try {
httpClient.request<List<String>> {
url("subjects")
url(URI(baseUrl).resolve("subjects").toString())
if (apiKey != null && apiSecret != null) {
basicAuth(apiKey, apiSecret)
}
Expand Down Expand Up @@ -224,7 +227,7 @@ class SchemaRegistry(
logger.info("Setting compatibility to {}", compatibility)
return try {
httpClient.requestEmpty {
url("config")
url(URI(baseUrl).resolve("config").toString())
method = HttpMethod.Put
contentType(ContentType("application", "vnd.schemaregistry.v1+json"))
setBody("{\"compatibility\": \"${compatibility.name}\"}")
Expand Down
4 changes: 0 additions & 4 deletions java-sdk/radar-schemas-tools/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
description = "RADAR Schemas specification and validation tools."

repositories {
maven(url = "https://jitpack.io")
}

dependencies {
implementation(project(":radar-schemas-registration"))
implementation(platform("com.fasterxml.jackson:jackson-bom:${Versions.jackson}"))
Expand Down
Loading