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

     1  # Pulsar
     2  
     3  Pulsar event-source subscribes to the topics, listens events and helps sensor trigger the workflows.
     4  
     5  ## Event Structure
     6  
     7  The structure of an event dispatched by the event-source over the eventbus looks like following,
     8  
     9              {
    10                  "context": {
    11                    "type": "type_of_event_source",
    12                    "specversion": "cloud_events_version",
    13                    "source": "name_of_the_event_source",
    14                    "id": "unique_event_id",
    15                    "time": "event_time",
    16                    "datacontenttype": "type_of_data",
    17                    "subject": "name_of_the_configuration_within_event_source"
    18                  },
    19                  "data": {
    20                     "body": "body is the message data",
    21                     "publishTime": "timestamp of the message",
    22                     "key": "message key"
    23                  }
    24              }
    25  
    26  ## Specification
    27  
    28  Pulsar event-source is available [here](https://github.com/argoproj/argo-events/blob/master/api/event-source.md#pulsareventsource).
    29  
    30  ## Setup
    31  
    32  1. To test locally, deploy a standalone Pulsar.
    33  
    34          apiVersion: apps/v1
    35          kind: Deployment
    36          metadata:
    37            name: pulsar
    38            labels:
    39              app: pulsar
    40          spec:
    41            replicas: 1
    42            template:
    43              metadata:
    44                name: pulsar
    45                labels:
    46                  app: pulsar
    47              spec:
    48                containers:
    49                  - name: pulsar
    50                    image: apachepulsar/pulsar:2.4.1
    51                    command:
    52                      - bin/pulsar
    53                      - standalone
    54                    imagePullPolicy: IfNotPresent
    55                    volumeMounts:
    56                      - mountPath: /pulsar/data
    57                        name: datadir
    58                restartPolicy: Always
    59                volumes:
    60                  - name: datadir
    61                    emptyDir: {}
    62            selector:
    63              matchLabels:
    64                app: pulsar
    65          ---
    66          apiVersion: v1
    67          kind: Service
    68          metadata:
    69            name: pulsar
    70          spec:
    71            selector:
    72              app: pulsar
    73            ports:
    74              - port: 8080
    75                targetPort: 8080
    76                name: http
    77              - port: 6650
    78                name: another
    79                targetPort: 6650
    80            type: LoadBalancer
    81  
    82  1. Port forward to the pulsar pod using kubectl for port 6650.
    83  
    84  1. For production deployment, follow the official Pulsar documentation online.
    85  
    86  1. Deploy the eventsource.
    87  
    88          kubectl -n argo-events apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/event-sources/pulsar.yaml
    89  
    90  1. Deploy the sensor.
    91  
    92          kubectl -n argo-events apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/sensors/pulsar.yaml
    93  
    94  1. Publish a message on topic `test`.
    95  
    96  1. Run `argo list` to find the workflow.
    97  
    98  ## Troubleshoot
    99  
   100  Please read the [FAQ](https://argoproj.github.io/argo-events/FAQ/).