mirror of
https://github.com/2martens/tsw-timetable.git
synced 2026-10-18 00:16:51 +02:00
change: Remove leader election and Kafka
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
package de.twomartens.support.model
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class LeadershipStatus {
|
||||
var isLeader = false
|
||||
}
|
||||
@@ -4,16 +4,13 @@ import io.swagger.v3.oas.annotations.media.Schema
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||
import org.springframework.boot.context.properties.bind.ConstructorBinding
|
||||
import org.springframework.boot.convert.DurationUnit
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope
|
||||
import java.time.Duration
|
||||
import java.time.temporal.ChronoUnit
|
||||
|
||||
@RefreshScope
|
||||
@ConfigurationProperties(prefix = "de.twomartens.timetable.statusprobe")
|
||||
@Schema(description = "Properties, to configure this Application")
|
||||
data class StatusProbeProperties @ConstructorBinding constructor(
|
||||
@DurationUnit(ChronoUnit.SECONDS) val scheduleDuration: Duration,
|
||||
@DurationUnit(ChronoUnit.MINUTES) val maxKafkaFailureDuration: Duration,
|
||||
val maxBlobFailureCount: Int,
|
||||
val maxFailurePercent: Int
|
||||
)
|
||||
|
||||
@@ -3,10 +3,8 @@ package de.twomartens.support.property
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||
import org.springframework.boot.context.properties.bind.ConstructorBinding
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope
|
||||
import java.time.ZoneId
|
||||
|
||||
@RefreshScope
|
||||
@ConfigurationProperties(prefix = "time")
|
||||
@Schema(description = "Properties to configure time")
|
||||
data class TimeProperties @ConstructorBinding constructor(
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package de.twomartens.support.service
|
||||
|
||||
import org.springframework.beans.factory.ObjectProvider
|
||||
import org.springframework.cloud.bus.BusBridge
|
||||
import org.springframework.cloud.bus.event.RemoteApplicationEvent
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
class BusService(
|
||||
private val busBridge: ObjectProvider<BusBridge>
|
||||
) {
|
||||
fun publishEvent(event: RemoteApplicationEvent) {
|
||||
busBridge.ifAvailable {
|
||||
it.send(event)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,4 @@ dependencies {
|
||||
implementation(libs.spring.openapi)
|
||||
|
||||
implementation(libs.bundles.spring.boot.security)
|
||||
implementation(libs.spring.cloud.leader.election)
|
||||
implementation(libs.spring.cloud.starter.bus.kafka)
|
||||
}
|
||||
Reference in New Issue
Block a user