Introducing the CloudEvents Player

    The above image is Figure 6.6 from Knative in Action.

    The CloudEvents Player acts as a Source for CloudEvents by intaking the URL of the Broker as an environment variable, . You will send CloudEvents to the Broker through the CloudEvents Player application.

    Create the CloudEvents Player Service:

    kn

    Expected Output

    1. Service 'cloudevents-player' created to latest revision 'cloudevents-player-vwybw-1' is available at URL:
    2. http://cloudevents-player.default.127.0.0.1.nip.io

    Why is my Revision named something different!

    YAML

    Once you’ve created your YAML file, named something like cloudevents-player.yaml, apply it by running the command:

      Expected Output

      Examining the CloudEvents Player

      You can use the CloudEvents Player to send and receive CloudEvents. If you open the Service URL in your browser, the Create Event form appears:

      The user interface for the CloudEvents Player

      What do these fields mean?

      For more information on the CloudEvents Specification, check out the .

      1. Fill in the form with whatever you data you want.
      2. Ensure your Event Source does not contain any spaces.
      3. Click SEND EVENT.

      Clicking the shows you the CloudEvent as the Broker sees it.

      ![Event_Details](images/event_details.

      Want to send events via the command line instead?

      As an alternative to the Web form, events can also be sent/viewed via the command line.

      To post an event:

      1. -H "Ce-Id: 123456789" \
      2. -H "Ce-Specversion: 1.0" \
      3. -H "Ce-Type: some-type" \
      4. -H "Ce-Source: command-line" \

      And to view events:

      The Introducing the CloudEvents Player - 图5 icon in the “Status” column implies that the event has been sent to our Broker… but where has the event gone? Well, right now, nowhere!