Creating a New Java App
If you haven't already, you'll first need to set up your development environment and ensure you have a Grainite server running (can be running locally in a Docker container).
1. Develop your Application
Generate an Application
First, generate the config file for the application.
Then, run the below command to generate the project and its files based on the configuration This will include a pom.xml
file for building with Maven. Optional: If you happen to already have an application which uses Maven or Gradle with a pom.xml
or build.gradle
file or for some other reason choose not to use gx gen all
, further instructions can be found at the end of the page.
Implement the Application Logic
Implement your action handlers, client programs, and any other parts of your app's functionality. You may use the API pages here or the Grainite Javadocs for reference.
2. Build and Load the Application
Build the application using Maven.
Then, load the application onto the Grainite server.
4. Run the load
Run the command below to start a sample load generator which will send events to the application.
<lib path>
can generally be found at `$HOME/grainite/lib`.
5. Observe the Application
Print all events in the topic:
gx topic dump orders_topic
Print all grains in the table:
gx table dump orders_table
Refer to the GX CLI document for more in-depth information about gx
.
Optional: Build Existing Application
If you happen to already have an application with a pom.xml
or build.gradle
file or for some other reason choose not to use gx gen all
(which can generate these for you), please follow the instructions below.
In your application's pom.xml
, add the following dependency and repository:
Last updated