Commit 04f5e0c9 authored by fsoldatos's avatar fsoldatos
Browse files

feat(automation): externalize grpc clients configuration

parent 9cf94be4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
# Define the host for the Context Service
quarkus.kubernetes.env.vars.context-service-host=context

# Define the host for the Device Service
quarkus.kubernetes.env.vars.device-service-host=device
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -14,7 +14,8 @@ import javax.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class ContextGatewayImpl implements ContextGateway {

    @GrpcClient ContextService delegate;
    @GrpcClient("context")
    ContextService delegate;

    @Override
    public Multi<DeviceEvent> getDeviceEvents() {
+2 −1
Original line number Diff line number Diff line
@@ -14,7 +14,8 @@ import javax.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class DeviceGatewayImpl implements DeviceGateway {

    @GrpcClient DeviceService deviceDelegate;
    @GrpcClient("device")
    DeviceService deviceDelegate;

    @Override
    public Uni<eu.teraflow.automation.device.model.DeviceConfig> getInitialConfiguration(
+10 −1
Original line number Diff line number Diff line
automation:
  should-subscribe-to-context-component: false
  should-subscribe-to-context-component: true
quarkus:
  grpc:
    server:
      port: 9999
      enable-reflection-service: true
    clients:
      context:
        host: ${quarkus.kubernetes.env.vars.context-service-host}
      device:
        host: ${quarkus.kubernetes.env.vars.device-service-host}
  http:
    port: 8080
  container-image:
@@ -31,3 +36,7 @@ quarkus:
      grpc-server:
        host-port: 9999
        container-port: 9999
    env:
      vars:
        context-service-host: context
        device-service-host: device
 No newline at end of file
+36 −0
Original line number Diff line number Diff line
@@ -28708,11 +28708,19 @@ public final class ContextOuterClass {
    context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder();
    /**
     * <pre>
     *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
     * </pre>
     *
     * <code>string endpoint_type = 2;</code>
     * @return The endpointType.
     */
    java.lang.String getEndpointType();
    /**
     * <pre>
     *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
     * </pre>
     *
     * <code>string endpoint_type = 2;</code>
     * @return The bytes for endpointType.
     */
@@ -28845,6 +28853,10 @@ public final class ContextOuterClass {
    public static final int ENDPOINT_TYPE_FIELD_NUMBER = 2;
    private volatile java.lang.Object endpointType_;
    /**
     * <pre>
     *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
     * </pre>
     *
     * <code>string endpoint_type = 2;</code>
     * @return The endpointType.
     */
@@ -28862,6 +28874,10 @@ public final class ContextOuterClass {
      }
    }
    /**
     * <pre>
     *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
     * </pre>
     *
     * <code>string endpoint_type = 2;</code>
     * @return The bytes for endpointType.
     */
@@ -29333,6 +29349,10 @@ public final class ContextOuterClass {
      private java.lang.Object endpointType_ = "";
      /**
       * <pre>
       *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
       * </pre>
       *
       * <code>string endpoint_type = 2;</code>
       * @return The endpointType.
       */
@@ -29349,6 +29369,10 @@ public final class ContextOuterClass {
        }
      }
      /**
       * <pre>
       *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
       * </pre>
       *
       * <code>string endpoint_type = 2;</code>
       * @return The bytes for endpointType.
       */
@@ -29366,6 +29390,10 @@ public final class ContextOuterClass {
        }
      }
      /**
       * <pre>
       *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
       * </pre>
       *
       * <code>string endpoint_type = 2;</code>
       * @param value The endpointType to set.
       * @return This builder for chaining.
@@ -29381,6 +29409,10 @@ public final class ContextOuterClass {
        return this;
      }
      /**
       * <pre>
       *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
       * </pre>
       *
       * <code>string endpoint_type = 2;</code>
       * @return This builder for chaining.
       */
@@ -29391,6 +29423,10 @@ public final class ContextOuterClass {
        return this;
      }
      /**
       * <pre>
       *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
       * </pre>
       *
       * <code>string endpoint_type = 2;</code>
       * @param value The bytes for endpointType to set.
       * @return This builder for chaining.
Loading