Loading src/automation/.env.example +2 −2 Original line number Diff line number Diff line # Define the host for the Context Service quarkus.kubernetes.env.vars.context-service-host=context quarkus.kubernetes.env.vars.context-service-host=ContextService # Define the host for the Device Service quarkus.kubernetes.env.vars.device-service-host=device No newline at end of file quarkus.kubernetes.env.vars.device-service-host=DeviceService No newline at end of file src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java +10 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import eu.teraflow.automation.context.ContextService; import eu.teraflow.automation.device.model.DeviceEvent; import io.quarkus.runtime.StartupEvent; import io.smallrye.mutiny.Multi; import java.time.Duration; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.event.Observes; import javax.inject.Inject; Loading @@ -29,7 +30,15 @@ public class ContextSubscriber { } public void listenForDeviceEvents() { Multi<DeviceEvent> deviceEventsMulti = contextService.getDeviceEvents(); Multi<DeviceEvent> deviceEventsMulti = contextService .getDeviceEvents() .onFailure() .retry() .withBackOff(Duration.ofSeconds(1)) .withJitter(0.2) .atMost(10); deviceEventsMulti .onItem() Loading src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java +1 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,6 @@ public class SimpleLivenessCheck implements HealthCheck { @Override public HealthCheckResponse call() { return HealthCheckResponse.up("Automation Service"); return HealthCheckResponse.up("Automation Service is live"); } } src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java 0 → 100644 +17 −0 Original line number Diff line number Diff line package eu.teraflow.automation; import javax.enterprise.context.ApplicationScoped; import org.eclipse.microprofile.health.HealthCheck; import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.Readiness; @Readiness @ApplicationScoped public class SimpleReadinessCheck implements HealthCheck { @Override public HealthCheckResponse call() { return HealthCheckResponse.up("Automation Service is ready"); } } src/automation/src/main/resources/application.yaml +2 −2 Original line number Diff line number Diff line Loading @@ -38,5 +38,5 @@ quarkus: container-port: 9999 env: vars: context-service-host: context device-service-host: device No newline at end of file context-service-host: ContextService device-service-host: DeviceService No newline at end of file Loading
src/automation/.env.example +2 −2 Original line number Diff line number Diff line # Define the host for the Context Service quarkus.kubernetes.env.vars.context-service-host=context quarkus.kubernetes.env.vars.context-service-host=ContextService # Define the host for the Device Service quarkus.kubernetes.env.vars.device-service-host=device No newline at end of file quarkus.kubernetes.env.vars.device-service-host=DeviceService No newline at end of file
src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java +10 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import eu.teraflow.automation.context.ContextService; import eu.teraflow.automation.device.model.DeviceEvent; import io.quarkus.runtime.StartupEvent; import io.smallrye.mutiny.Multi; import java.time.Duration; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.event.Observes; import javax.inject.Inject; Loading @@ -29,7 +30,15 @@ public class ContextSubscriber { } public void listenForDeviceEvents() { Multi<DeviceEvent> deviceEventsMulti = contextService.getDeviceEvents(); Multi<DeviceEvent> deviceEventsMulti = contextService .getDeviceEvents() .onFailure() .retry() .withBackOff(Duration.ofSeconds(1)) .withJitter(0.2) .atMost(10); deviceEventsMulti .onItem() Loading
src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java +1 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,6 @@ public class SimpleLivenessCheck implements HealthCheck { @Override public HealthCheckResponse call() { return HealthCheckResponse.up("Automation Service"); return HealthCheckResponse.up("Automation Service is live"); } }
src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java 0 → 100644 +17 −0 Original line number Diff line number Diff line package eu.teraflow.automation; import javax.enterprise.context.ApplicationScoped; import org.eclipse.microprofile.health.HealthCheck; import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.Readiness; @Readiness @ApplicationScoped public class SimpleReadinessCheck implements HealthCheck { @Override public HealthCheckResponse call() { return HealthCheckResponse.up("Automation Service is ready"); } }
src/automation/src/main/resources/application.yaml +2 −2 Original line number Diff line number Diff line Loading @@ -38,5 +38,5 @@ quarkus: container-port: 9999 env: vars: context-service-host: context device-service-host: device No newline at end of file context-service-host: ContextService device-service-host: DeviceService No newline at end of file