Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StreamX Sample Project

This project contains sample implementations of StreamX to demonstrate how to use StreamX. These services can be used to create sample StreamX mesh.

Full documentation is available on https://www.streamx.dev/guides/index.html.

Project structure

Each StreamX project should be organized in a specific way and should follow the conventions described below.

The following are recommended directories:

  • data - sample data should be placed here
  • mesh - resources required to configure and run StreamX Mesh
  • scripts - all useful scripts and resources should be placed here
  • services - your StreamX Processing and Delivery Services (as well as other Maven modules) should be placed here

Prerequisites

To work with this repository you need:

  • OpenJDK 17+ installed with JAVA_HOME configured appropriately
  • Docker
  • StreamX CLI

StreamX CLI

To install StreamX CLI, run:

# for Linux/MacOS
brew install streamx-dev/tap/streamx

or

# for Windows
scoop bucket add streamx-dev https://github.com/streamx-dev/scoop-streamx-dev.git
scoop install streamx

To upgrade StreamX CLI, run:

# for Linux/MacOS
brew update
brew upgrade streamx

or

# for Windows
scoop update streamx

For more information, visit StreamX CLI Reference.

Packaging

To build StreamX project, run:

# For Linux/MacOS
./mvnw clean install

or

# For Windows
mvnw.cmd clean install

This command builds both the Maven artefacts and the Docker images needed to start the local StreamX mesh.

Running local StreamX Mesh

To start local instance of Mesh run:

cd mesh
streamx run

The above command runs the StreamX mesh defined in the mesh.yaml file located in the current directory. For more information, visit StreamX CLI Reference.

Ingesting local mesh with sample data

Optionally run script to trigger sample publications and see results:

streamx batch publish data

To see results of publication - visit:

For more information, visit StreamX CLI Reference.

Debugging

If you need to debug a single service as part of the StreamX Mesh, you need to comment out debugged service in your mesh YAML
e.g. to debug graphql-delivery-service comment out such fragment as below:

delivery:
#  graphql:
#    image: graphql-delivery-service
#    incoming:
#      products:
#        topic: outboxes/products
#    port: 8084
  web:
    image: web-delivery-service
    incoming:
      pages:
        topic: outboxes/pages
      web-resources:
        topic: outboxes/web-resources
    port: 8081

Then, run your mesh using standard streamx run command:

cd mesh
streamx run

Finally make sure that the application-streamx-mesh-debug.properties file in the debugged service reflects the mesh configuration (topics configuration, exposed port, etc.). Then run the debugged service with the streamx-mesh-debug profile, e.g. for graphql-delivery-service run the following command:

cd services/graphql-delivery-service
quarkus dev -Dquarkus.profile=streamx-mesh-debug

About

StreamX sample project

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages