Running Docker Images Tutorial

This tutorial describes how to run Docker images that contain StreamBase Applications, and to send data to that application.

This page assumes:

  • You have the Docker for Windows or Docker for Mac client programs installed and running on the host machine.

  • You have a Docker image available. For steps to create one from StreamBase Studio, see Creating Docker Images Tutorial.

  • You have installed that Studio-built Docker image into a Docker container, running and managed by the Docker client programs on your development host machine. Again, see Creating Docker Images Tutorial.

These steps only work when using the Docker Community Edition for Windows or Mac from store.docker.com. Other Docker client solutions may work, but are explicitly not supported.

Docker for Windows requires 64-bit Windows 10 Pro with Hyper-V available. Note that installing Hyper-V disables VMware Workstation or Oracle VirtualBox on the same computer, because Windows 10 allows only one virtualization hypervisor to run at the same time.

Note

Docker for Windows installs Microsoft Hyper-V as its virtual machine hosting solution. On some Windows 10 machines, there can an incompatibility between Hyper-V and the StreamBase Runtime on the host. The symptom is that more than one node installed by the StreamBase Runtime on the Windows host (not in Docker) do not stay running. If you encounter this issue, see this troubleshooting page.

The following demonstrates how to send data to a StreamBase Application that is currently running in a Docker container. This tutorial uses a Windows conventions for its example commands.

The following assumes firstapp in Docker is running on the default StreamBase port, 10000, in the Docker container. On the Creating Docker Images Tutorial page, you ran the Docker image with commands that redirected the local machine's port 10000 to the Docker virtual machine's port 10000 (and the same the the Administration port, 2000). The commands on this page contact that default port as if contacting a locally running StreamBase Application.

Using the created and started Docker image as explained in Creating Docker Images Tutorial, you will send data to the application running in Docker both manually and with a feed simulation.

Sending Data to an Application Running in Docker

This tutorial demonstrates how to send tuples to a StreamBase Application running in a Docker image. First, we will send manually enqueued tuples:

  1. Set up a dequeue. Open a StreamBase Command Prompt (Windows) or StreamBase-configured shell prompt (macOS). Run: sbc dequeue. This is window is SCP 1.

  2. Set up an enqueue. Open another StreamBase Command Prompt or shell prompt window and run: sbc enq TradesIn. This is SCP 2.

  3. Send data manually. In the enqueue window, send the following tuples:

    • ibm,4000

    • yhoo,5600

    • goog,12000

  4. Observe the following in the dequeue window:

    • AllTheRest,ibm,4000

    • AllTheRest,yhoo,5600

    • BigTrades,goog,12000

  5. Type Ctrl+C in each command prompt to stop the enqueue and dequeue, respectively.

Next, run a feed simulation to enqueue tuples:

  1. In SCP 2, run this command: sbc deq AllTheRest.

  2. Notice that no output is produced yet. The command prompts are waiting to show output from the two output streams.

  3. Return to StreamBase Studio, using the same workspace used in Creating Docker Images Tutorial.

  4. In your sample_firstapp project, navigate to and select src/main/resources.

  5. Right-click and select StreamBaseOpen Command Prompt Here.

  6. In the new Command Prompt, SCP 3, run sbfeedsim -f firstapp-enum.sbfs.

  7. Data now flows to the two output ports. Only trades with stock quantities over 10000 go to the BigTrades port.

    Notice the application is receiving output and that you can send tuples to an EventFlow fragment, all running in Docker.

  8. Type Ctrl+C in SCP 3 to end the feed simulation.

  9. To verify you are running no local services, from the feed simulation command prompt window, run epadmin display services.