github.com/argoproj/argo-events@v1.9.1/docs/sensors/triggers/pulsar-trigger.md (about)

     1  # Pulsar Trigger
     2  
     3  Pulsar trigger allows sensor to publish events on Pulsar topic. This trigger helps source the events from outside world into your messaging queues.
     4  
     5  ## Specification
     6  
     7  The Pulsar trigger specification is available [here](https://github.com/argoproj/argo-events/blob/master/api/sensor.md#pulsartrigger).
     8  
     9  ## Walkthrough
    10  
    11  1. Consider a scenario where you are expecting a file drop onto a Minio bucket and want to place that event on a Pulsar topic.
    12  
    13  1. Set up the Minio Event Source [here](https://argoproj.github.io/argo-events/setup/minio/).
    14     Do not create the Minio sensor, we are going to create it in next step.
    15  
    16  1. Lets create the sensor.
    17  
    18          apiVersion: argoproj.io/v1alpha1
    19          kind: Sensor
    20          metadata:
    21            name: minio-sensor
    22          spec:
    23            dependencies:
    24              - name: test-dep
    25                eventSourceName: minio
    26                eventName: example
    27            triggers:
    28              - template:
    29                  name: pulsar-trigger
    30                  pulsar:
    31                    # Pulsar URL
    32                    url: pulsar://pulsar.argo-events.svc:6650
    33                    # Name of the topic
    34                    topic: minio-events
    35                    payload:
    36                      - src:
    37                          dependencyName: test-dep
    38                          dataKey: notification.0.s3.object.key
    39                        dest: fileName
    40                      - src:
    41                          dependencyName: test-dep
    42                          dataKey: notification.0.s3.bucket.name
    43                        dest: bucket
    44  
    45  1. The Pulsar message needs a body. In order to construct message based on the event data, sensor offers
    46     `payload` field as a part of the Pulsar trigger.
    47  
    48     The `payload` contains the list of `src` which refers to the source event and `dest` which refers to destination key within result request payload.
    49  
    50     The `payload` declared above will generate a message body like below.
    51  
    52          {
    53              "fileName": "hello.txt" // name/key of the object
    54              "bucket": "input" // name of the bucket
    55          }
    56  
    57  1. Drop a file called `hello.txt` onto the bucket `input` and you will receive the message on Pulsar topic