Satori Docs

Your definitive guide to subscribing and publishing live data

Java Streambot™ Quickstart Direct link

This quick start guide walks you through the process of building and running your own Java Streambot™ using the satori-bot-example project. The Streambot™ will subscribe to the channel for messages and will publish those messages to the example.out channel.

Set up the Development Environment Direct link

To create and run Streambots™, you need a Satori account. If you have not already done so, sign up or ask for an invitation from an existing member of your organization.

To set up your Streambot™ development environment:

  1. Clone the satori-bot-example project from the Satori Git repo.

  2. Install the RTM CLI tool if you want to compile, run, and test your Streambot™ from the command line.

  3. Install IntelliJ and Java SDK 8.

  4. Launch IntelliJ and ensure that the JDK is set up:

    1. Navigate to Configure > Project Defaults > Project Structure.

    2. Select JDK from the Project SDK dropdown.

    3. Verify that Java version 1.8.x appears in the dropdown.
    4. Click Apply and then OK.

Create a Dev Portal Project Direct link

Each Streambot™ instance requires an associated Dev Portal project that includes the required RTM endpoint and an appkey.

To create a project on the Dev Portal:

  1. Sign in to the Dev Portal at
  2. Navigate to Projects > Create a project.
  3. In the Project name field, specify Streambot™ Quickstart Java and click Save.
    The Dev Portal creates the project and displays the Project details page in the General tab.
  4. Note the Appkey and Endpoint values that will be used when running this Quickstart project.

Import the Project into IDE Direct link

Import the quickstart sample project into IntelliJ:

  1. Click Import Project on IntelliJ’s welcome screen, navigate to the cloned project’s directory, navigate to the java-streambot subdirectory, and click Open.

  2. Click Import Project from External Model, select Gradle from the list, and click Next.

  3. Click Finish on the next screen.
    The project will open and automatically download the dependencies.

Configure the Streambot™ Direct link

To run and test your quick start Streambot™ locally, you need to set up the local configuration file with the appkey and the endpoint for the demo channel.

  1. In the Dev Portal, navigate to Projects > My projects.

  2. Click the Streambot™ Quickstart Java project. 

  3. In the Connection Information section in the General tab, click Copy next to the Appkey.

  4. In your IntelliJ project, open config.json in the satori-bot-example project that you cloned in Set Up Development Environment.

  5. Paste the Appkey value into the appKey field of the subscriberConfigs object in config.json.

  6. In the Dev Portal, click Copy next to the Endpoint.

  7. Paste the Endpoint value into the host field of the subscriberConfigs object in config.json.

  8. Save config.json.

The following code snippet shows an example config.json.

// Subscriber configuration
// Configure the channels from which the local Streambot™ should be receiving data
"subscriberConfigs": {
 "main": {
   "appKey": "0424Dedbb6f7c0cb3CFf0449531eaCcE",
   "host": "wss://",

Run the Streambot™ Locally Direct link

This section describes how to build and run the satori-bot-example quick start project locally before deploying the Streambot™ on the Dev Portal. You will be able to test and debug the quick start Streambot™ on your local machine using your IDE's debugging features, such as breakpoints. 

You can locally run Streambots™ in one of the following ways:

  • In IDE, e.g. IntelliJ
  • From the command line

Run the Streambot™ in IntelliJ

To run your Streambot™ in the IntelliJ IDE:

  1. From the Project view, navigate to src > main > java > com.satori.bots.example and open
  2. Click the small green arrow to the left of the public static void main() method and select Run 'MyBot.main()'.

    Your project will be built and executed. You will see your Streambot™ running.

To debug your Streambot™ and step through the code in IntelliJ IDE:

  1. Navigate to Run > Stop if the project is still running.

  2. Set a breakpoint in MyBot.onSetup.

  3. Navigate to View > Tools Windows > Gradle.

  4. In the Grade projects pane, navigate to satori-bot-example-root > Tasks > other > runBot.

  5. Right click and select Debug ‘java-streambot...’ to start debugging.
    The execution will halt at the breakpoint you set, and you can step through the code.

Run the Streambot™ on the Command Line

To run and test your Streambot™ from the command line using RTM CLI:

  1. Cd to the satori-bot-example directory and then to the java-streambot subdirectory.
  2. Stop the Streambot™ if running.
  3. Start the Streambot™ using the following command:
./gradlew runBot
  1. In a separate terminal window, start a client that listens to your channel using the following CLI tool command. Replace <ENDPOINT> and <APPKEY> with the respective values from the Dev Portal.
satori-rtm-cli --endpoint=<ENDPOINT> --appkey=<APPKEY> subscribe example.out
  1. In another terminal window, publish a message to the channel:
echo '{"key1":"value1", "key2":"value2", "key3":"value3"}' | satori-rtm-cli --endpoint=<ENDPOINT> --appkey=<APPKEY> publish

The subscriber that you started in Step #4 will begin receiving the messages as the Streambot™ publishes them to the example.out channel.

Deploy the Streambot™ Direct link

Now you will build the JAR and deploy your Streambot™ on the Dev Portal.

There are two ways to build the JAR to deploy your Streambot™:

  • You can build the JAR in your IDE.
  • You can build the JAR from the command line.

Build the JAR in IntelliJ

  1. In your IntelliJ project, navigate to View > Tools Windows > Gradle.

  2. Navigate to satori-bot-example-root > Tasks > other, and double click botJar. This builds java-streambot-0.1.jar and stores it in the build/libs directory under java-streambot.

Build the JAR from the Command Line

To build the JAR from the command line:

  1. Cd to the satori-bot-example directory and then to the java-streambot subdirectory.
  2. Execute the following command to build the java-streambot-01.jar in the build/libs directory under java-streambot.
./gradlew botJar

Deploy the Streambot™

  1. In the Dev Portal, navigate to Streambots > Create a streambot.
  2. Click and select Java8 from the Language dropdown.
  3. Click Untitled Streambot and specify the name of the streambot: Streambot™ Quickstart Java.

  4. In the expanded Basic section of the Configuration pane, specify:

    •  Project: Streambot™ Quickstart Java

    •  Role: default

    • Appkey: Click and select the appkey

  5. Click the Input Channels field to display the channel selection popup:

    1. Select My private channel.

    2. Click Subscription View to enter a view query. 

    3. SQL: SELECT * FROM ``

    4. Period: Leave empty.

  6. Click outside the channel selection popup to close it.
  7. In the expanded Advanced section, specify your custom JSON data for the satori-bot-example Quickstart project. The example onSetup method looks for this particular data field. The quickstart Streambot™ will use this JSON to republish the channel data.
{ "outputChannel": "example.out" }
  1. In the Code Editor section, click the upload icon. 
  2. Browse and select your JAR file, satori-bot-example/java-streambot/build/libs/java-streambot-0.1.jar, or drag and drop the file onto this icon to upload it.
  3. Click Create to complete the creation process. The real time output will be displayed in the Console pane when the Streambot™ instance starts.

Verify the Streambot™ Direct link

After the Streambot™ instance starts, publish messages to the channel to test its functionality.

To view the Streambot™ output in the Dev Portal console:

  1. Navigate to Projects > My projects.
  2. Click Streambot™ Quickstart Java in the Projects list.
  3. In the Console tab, click Enter Channel and type example.out in the field.
    The console displays the activities in the example.out channel.

To publish a message for the Streambot™:

  1. Open a second instance of the Dev Portal.
  2. Navigate to Projects > My streambots.
  3. Click Streambot™ Quickstart Java in the Projects list.
  4. In the Console tab, click Enter Channel and type in the field.
  5. Click the orange icon at the bottom right of the console box to publish a message.
  6. Specify the following JSON in the Publish Message field:
     {"test": "Hello world!"}
  7. Click Send.
  8. In the first instance of the Dev Portal, verify that the Streambot™ republishes the message to the example.out channel.