Language SDKs
Unmeshed Java SDK
This README will guide you on how to set up Unmeshed credentials, run workers, and get started with the Unmeshed platform using the Java SDK.
Prerequisites
Before running your Java project, make sure you have:
- Java Development Kit (JDK): Java 21 or above.
- Maven or Gradle: For managing dependencies.
- Unmeshed SDK dependency: See your
build.gradleorpom.xml. - Environment Variables:
UNMESHED_AUTH_ID: Your Unmeshed authentication ID.UNMESHED_AUTH_TOKEN: Your Unmeshed authentication token.UNMESHED_ENGINE_HOST: Base URL for the Unmeshed server (defaults tohttp://localhost).UNMESHED_ENGINE_PORT: Port (defaults to8080).
For help generating your Auth ID and Auth Token, see the Creating Client Credentials.
Setup Instructions
- Clone the Repository:
- Run
Main.javato start the example application.
Writing Your Own Worker
-
Check example workers in
io.unmeshed.sdk.samples.workers:ArithmeticWorkerHelloWorldWorker
-
Create a new worker class, or add a new method in an existing worker class.
-
Annotate the method with
@WorkerFunction(name = "<worker_name>"), where<worker_name>is the worker queue name you want to bind to.
Example:
Register Inline (Lambda) Workers
You can register lambda workers directly with the client:
Accessing Execution Context
To get additional context such as step ID or process ID inside your worker:
See HelloWorldWorker.java for a concrete example.
Process Management
The SDK provides comprehensive process definition management capabilities. See ProcessManagementExamples.java for a complete working example.
Create a Process Definition
Create a Step Definition
Get Process Definition (Latest or Specific Version)
Get All Process Definitions
Update a Process Definition
Delete Process Definitions
Complete Process Management Example
ProcessManagementExamples.java demonstrates:
- Creating a process definition with steps
- Fetching the latest version of a process
- Retrieving all process definitions
- Updating an existing process definition
- Deleting process definitions
Visit Unmeshed to get started.