sdr2evtstreams

command
v4.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

README

Horizon SDR To IBM Event Streams Service

This example illustrates a more realistic Horizon edge service by including additional aspects of typical edge services.

Preconditions for Using the SDR To IBM Event Streams Example Edge Service

If you haven't done so already, you must do these steps before proceeding with the sdr2evtstreams example:

  1. Install the Horizon management infrastructure (exchange and agbot).

  2. Install the Horizon agent on your edge device and configure it to point to your Horizon exchange.

  3. Set your exchange org:

export HZN_ORG_ID=<your-cluster-name>
  1. Create a cloud API key that is associated with your Horizon instance, set your exchange user credentials, and verify them:
export HZN_EXCHANGE_USER_AUTH=iamapikey:<your-API-key>
hzn exchange user list
  1. Choose an ID and token for your edge node, create it, and verify it:
export HZN_EXCHANGE_NODE_AUTH=<choose-any-node-id>:<choose-any-node-token>
hzn exchange node create -n $HZN_EXCHANGE_NODE_AUTH
hzn exchange node confirm
  1. Deploy (or get access to) an instance of IBM Event Streams that the sdr2evtstreams sample can send its data to. Ensure that the topic sdr-audio is created in Event Streams. Using information from the Event Streams UI, export these environment variables:
    • EVTSTREAMS_API_KEY
    • EVTSTREAMS_BROKER_URL

Using the SDR To IBM Event Streams Edge Service with Deployment Pattern

  1. Get the user input file for the sdr2evtstreams sample:
wget https://github.com/open-horizon/examples/raw/master/edge/evtstreams/sdr2evtstreams/horizon/userinput.json
  1. Register your edge node with Horizon to use the sdr2evtstreams pattern:
hzn register -p IBM/pattern-ibm.sdr2evtstreams -f userinput.json
  1. The edge device will make an agreement with one of the Horizon agreement bots (this typically takes about 15 seconds). Repeatedly query the agreements of this device until the agreement_finalized_time and agreement_execution_start_time fields are filled in:
hzn agreement list
  1. Once the agreement is made, list the docker container edge service that has been started as a result:
sudo docker ps
  1. On any machine, install kafkacat, then subscribe to the Event Streams topic to see the json data that sdr2evtstreams is sending:
kafkacat -C -q -o end -f "%t/%p/%o/%k: %s\n" -b $EVTSTREAMS_BROKER_URL -X api.version.request=true -X security.protocol=sasl_ssl -X sasl.mechanisms=PLAIN -X sasl.username=token -X sasl.password=$EVTSTREAMS_API_KEY -X -t $EVTSTREAMS_TOPIC
  1. See the sdr2evtstreams service output:
hzn service log -f ibm.sdr2evtstreams
  1. Unregister your edge node, stopping the sdr2evtstreams service:
hzn unregister -f

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL