Skip to main content

Language Examples

This article helps you to set up a stream and start sending data to STRM Privacy, using your language of preference.

note

Missing your language of preference? Please contact us, and let us know which language is missing.

tip

Start your own driver if it doesn't exist yet, with the details of the quickstart Sending and receiving manually and the existing open-source drivers.

Setting up a stream

This quickstart assumes that you have created an account on the console.

Using the language examples

In order to run these examples, you need the following:

  • An input stream to send data to (if you don’t know how, learn how to create streams)
  • The credentials for this stream.

The following demo applications show how dummy data can be sent with a certain frequency. The data that is sent is quite static and does not result in any useful patterns for analysis, however, it does show how data can be constructed and transferred to STRM Privacy.

note

Use strm listen web-socket (stream-name) to inspect the data that is being sent and to debug issues.

note

To send events to your own Customer Cloud Instance of the STRM Data Plane, you will need to modify the client configuration by specifying the gateway host, port and http scheme.

java-driver java-avro

This example is also available on GitHub . Please see the repository for the readme.

Short steps to start sending data:

git clone https://github.com/strmprivacy/java-examples
cd java-examples
strm create stream demo
clientId=$(strm get stream demo --output json | jq -r '.streamTree.stream.credentials[0].clientId')
clientSecret=$(strm get stream demo --output json | jq -r '.streamTree.stream.credentials[0].clientSecret')
mvn package
java -jar target/java-examples-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
$clientId $clientSecret
org.eclipse.jetty.util.log                  - Logging initialized ...
io.strmprivacy.driver.client.AuthService - Initializing a new Auth Provider
io.strmprivacy.examples.Sender - Successfully sent event
io.strmprivacy.examples.Sender - Successfully sent event
io.strmprivacy.examples.Sender - Successfully sent event
...
Loading...

Receiving data

See strm listen web-socket for a debugging view on the events.

See exporting to Kafka or batch exporters for production event consuming.