Introducing LittleHorse Extensions for Quarkus
We are excited to announce the release of the LittleHorse Extensions for Quarkus, enabling developers to build powerful Quarkus applications with seamless LittleHorse workflow integration.
What are the LittleHorse Extensions for Quarkus?
The LittleHorse Extensions for Quarkus provide a powerful Quarkus-based runtime for interacting with LittleHorse Kernel and Pony ID. The extensions include:
Base Extension
The LittleHorse Quarkus extension is the base extension which allows you to develop on Quarkus and LittleHorse. It provides:
- Automatic Registration: Automatically registers
WfSpecs,TaskDefs, andUserTasks using simple annotations - Task Worker Management: Manages the lifecycle of your Task Workers automatically
- Health Checks: Built-in health check reporting using SmallRye Health
- gRPC Client Beans: Out-of-the-box beans for injecting LittleHorse gRPC clients into your services
- Native Compilation: Build native executables optimized for serverless and containerized environments
RESTful Gateway Extension
The LittleHorse Quarkus RESTful Gateway extension provides a RESTful interface for interacting with LittleHorse, allowing you to interact with LittleHorse workflows using standard HTTP/REST APIs instead of gRPC.
Why Quarkus?
Quarkus is a modern Java framework designed for cloud-native applications, offering fast startup times, low memory footprint, and excellent developer experience. By combining Quarkus with LittleHorse, developers can build event-driven, workflow-powered applications that are both performant and maintainable.
Key Benefits
- Developer Experience: Use simple annotations like
@LHWorkflowand@LHTaskto define workflows and tasks - Automatic Lifecycle Management: No need to manually register workflows or manage task workers
- Integration Ready: Easily combine with other Quarkus extensions like Quarkus REST to build APIs
- Production Ready: Build native executables for optimal performance in serverless and containerized environments
- Type Safety: Full type safety with Java and seamless integration with Quarkus's dependency injection
How It Works
With the LittleHorse Runtime Extension, defining workflows and tasks is as simple as adding annotations to your Java classes:
@LHTask
public class HelloWorldWorker {
@LHWorkflow("hello-world")
public void helloWorldWorkflow(WorkflowThread wf) {
wf.execute("hello-world", wf.declareStr("name"));
}
@LHTaskMethod("hello-world")
public void helloWorldTask(String name) {
System.out.println("Hello " + name);
}
}
Integration with Quarkus REST
One of the powerful features of LittleHorse Runtime is how easily it integrates with other Quarkus extensions. For example, you can combine it with Quarkus REST to build REST APIs that wrap LittleHorse functionality:
@Path("/identity-verification")
public class IdentityResource {
@Inject
LittleHorseBlockingStub lhClient;
@POST
@Path("/start")
public String startVerification(IdentityRequest request) {
// Start workflow using lhClient
}
}
Examples
The repository includes comprehensive examples to help you get started:
- Basic Example: How to run a task and register a workflow
- Child Workflow: How to build parent and child workflows
- Reactive: How to use
LittleHorseReactiveStubobject - REST: How to run a workflow run request from a REST endpoint
- User Tasks: How to use and register user tasks
Get Started
Ready to build with LittleHorse Extensions for Quarkus? Here's how to get started:
- Try the Quickstart: Follow our Quarkus Extension quickstart to see it in action
- Check Out Examples: Explore the examples repository for more use cases
- Use the RESTful Gateway: Pull the Docker image and start using the RESTful gateway:
docker pull ghcr.io/littlehorse-enterprises/lh-restful-gateway:latest - Read the Documentation: Learn more about LittleHorse Runtime and its capabilities
Availability
The extensions are available on Maven Central and can be added to your Quarkus project dependencies. The RESTful Gateway is also available as a Docker image from GitHub Container Registry.
Learn More
The LittleHorse Extensions for Quarkus are open-source and available under the Apache License, Version 2.0. Check out the GitHub repository to explore the code, contribute, or report issues.
Join us on Slack to connect with other users and share your experiences. Give us a star on GitHub to support our open-source efforts!