github.com/argoproj/argo-events@v1.9.1/docs/eventsources/generic.md (about)

     1  # Generic EventSource
     2  
     3  Generic eventsource extends Argo-Events eventsources via a simple gRPC contract.
     4  This is specifically useful when you want to onboard a custom eventsource
     5  implementation.
     6  
     7  ## Contract
     8  
     9  In order to qualify as generic eventsource, the eventsource server needs to
    10  implement following gRPC contract.
    11  
    12          syntax = "proto3";
    13  
    14          package generic;
    15  
    16          service Eventing {
    17              rpc StartEventSource(EventSource) returns (stream Event);
    18          }
    19  
    20          message EventSource {
    21              // The event source name.
    22              string name = 1;
    23              // The event source configuration value.
    24              bytes config = 2;
    25          }
    26  
    27          /**
    28          * Represents an event
    29          */
    30          message Event {
    31              // The event source name.
    32              string name = 1;
    33              // The event payload.
    34              bytes payload = 2;
    35          }
    36  
    37  The proto file is available [here](https://github.com/argoproj/argo-events/blob/master/eventsources/sources/generic/generic.proto).
    38  
    39  ## Architecture
    40  
    41  ![arch](../assets/generic-eventsource.png)
    42  
    43  Consider a generic eventsource.
    44  
    45          apiVersion: argoproj.io/v1alpha1
    46          kind: EventSource
    47          metadata:
    48            name: generic
    49          spec:
    50            generic:
    51              example:
    52                insecure: true
    53                url: "generic-event-source-server.argo-events.svc:8080"
    54                config: |-
    55                  key1: value1
    56                  key2: value2
    57  
    58  The values placed under `config` field follows a free-form style and Argo-Events
    59  eventsource client is not opinionated about them. Although, it is expected that
    60  the eventsource server implemented by the user is able to parse the
    61  configuration.
    62  
    63  ## Flow
    64  
    65  1. The eventsource client connects to the server via the `url` defined under
    66     eventsource `spec` and sends over the configuration defined under `config`
    67     over an RPC call.
    68  
    69  2. The eventsource server then parses the configuration and connects to any
    70     external source if required to consume the events. The eventsource server can
    71     produce events without connecting to any external source, e.g. a special
    72     implementation of calendar events.
    73  
    74  3. The events from eventsource server are streamed back to the client.
    75  
    76  4. Client then writes the events to the eventbus which are read by the sensor to
    77     trigger the workflows.
    78  
    79  ## Connection Strategy
    80  
    81  The eventsource client performs indefinite retries to connect to the eventsource
    82  server and receives events over a stream upon successful connection. This also
    83  applies when the eventsource server goes down.