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.
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
To work with this repository you need:
- OpenJDK 17+ installed with JAVA_HOME configured appropriately
- Docker
- StreamX CLI
To install StreamX CLI, run:
# for Linux/MacOS
brew install streamx-dev/tap/streamxor
# for Windows
scoop bucket add streamx-dev https://github.com/streamx-dev/scoop-streamx-dev.git
scoop install streamxTo upgrade StreamX CLI, run:
# for Linux/MacOS
brew update
brew upgrade streamxor
# for Windows
scoop update streamxFor more information, visit StreamX CLI Reference.
To build StreamX project, run:
# For Linux/MacOS
./mvnw clean installor
# For Windows
mvnw.cmd clean installThis command builds both the Maven artefacts and the Docker images needed to start the local StreamX mesh.
To start local instance of Mesh run:
cd mesh
streamx runThe above command runs the StreamX mesh defined in the mesh.yaml file located in the current directory.
For more information, visit StreamX CLI Reference.
Optionally run script to trigger sample publications and see results:
streamx batch publish dataTo see results of publication - visit:
- Generated pages
- GraphQL Console and launch some queries (details in GraphqlDeliveryService)
For more information, visit StreamX CLI Reference.
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: 8081Then, run your mesh using standard streamx run command:
cd mesh
streamx runFinally 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