Spring Boot
bloge-spring packages BLOGE into a familiar Spring Boot integration. It auto-configures the runtime, discovers operators from the application context, loads .bloge files, and exposes actuator endpoints for graph introspection.
What the starter provides
| Feature | Description |
|---|---|
| Operator discovery | Registers Spring beans annotated with @BlogeOperator |
| Graph loading | Compiles .bloge files from configured classpath locations |
GraphEngine bean | Builds the engine with discovered registries, listeners, and interceptors |
| Actuator endpoints | Exposes graph inventory and graph details under /actuator/bloge |
| Optional durable integration | Wires runtime stores when bloge-durable and a DataSource are present |
| Optional observability | Auto-registers metrics, tracing, and logging components when telemetry libs are available |
Quick start
1. Add the dependency
xml
<dependency>
<groupId>com.leanowtech.bloge</groupId>
<artifactId>bloge-spring</artifactId>
<version>${bloge.version}</version>
</dependency>2. Publish an operator bean
java
@BlogeOperator("FetchUserOperator")
public class FetchUserOperator implements Operator<Map<String, Object>, Map<String, Object>> {
@Override
public Map<String, Object> execute(Map<String, Object> input, OperatorContext ctx) {
String userId = (String) input.get("userId");
User user = userService.findById(userId);
return Map.of("id", user.id(), "name", user.name());
}
}3. Place DSL files on the classpath
src/main/resources/bloge/order-process.blogebloge
graph orderProcess {
node fetchUser : FetchUserOperator {
input { userId = ctx.userId }
timeout = 3s
}
}4. Inject and execute
java
@Service
class OrderService {
private final GraphEngine engine;
private final List<Graph> graphs;
OrderService(GraphEngine engine, List<Graph> graphs) {
this.engine = engine;
this.graphs = graphs;
}
GraphResult processOrder(String userId) {
Graph graph = graphs.stream()
.filter(g -> g.name().equals("orderProcess"))
.findFirst()
.orElseThrow();
return engine.execute(graph, new GraphContext(Map.of("userId", userId)));
}
}Auto-configured beans
BlogeAutoConfiguration can provide these building blocks automatically:
| Bean | Description |
|---|---|
OperatorRegistry | Scans @BlogeOperator beans and registers them |
GraphEngine | Wires interceptors, listeners, and runtime integrations |
GraphLoader | Compiles DSL assets |
List<Graph> | Loads all configured DSL graphs |
ArchiveService | Available when durable runtime stores are present |
DurableControlPlaneService | Available when durable runtime stores are present |
Configuration properties
Core properties
yaml
spring:
bloge:
dsl-locations: classpath:bloge/
hot-reload: false
default-timeout: 30s
accessor-mode: method-handleDurable runtime properties
When bloge-durable is on the classpath, the starter supports routing, archive, replica, and tenant-oriented configuration under spring.bloge.durable.*.
yaml
spring:
bloge:
durable:
data-source-bean: primaryDataSource
routing:
mode: TENANT
tenant-strategy: SEPARATE_DATABASE
fallback-shard-id: shared
archive:
retention: 30d
batch-size: 500
policy: MOVE_TO_ARCHIVEObservability properties
yaml
spring:
bloge:
observability:
metrics:
enabled: true
prefix: bloge
tracing:
enabled: true
logging:
enabled: trueActuator endpoints
With Spring Boot Actuator on the classpath, BLOGE exposes:
GET /actuator/blogefor graph inventoryGET /actuator/bloge/{graphName}for graph details
Typical payloads include graph counts, source nodes, terminal nodes, and edge counts, which makes it easier to inspect registered orchestration assets in a running service.
Best practices
- Keep operator beans focused and side-effect aware.
- Store DSL graphs under a dedicated
classpath:bloge/folder. - Use actuator endpoints for inventory and production sanity checks.
- Add
bloge-durableandbloge-metrics-otelonly when the service actually needs those capabilities.
Next steps
- Persist long-running runs with Durable Flows
- Add telemetry through Observability
- Generate metadata for Studio in Maven Plugin & Lint