Examples in Helix are meant to be small, readable reference points rather than full tutorials. This page is generated from the repository’s examples/ directory, so it stays aligned with the examples we actually ship.
Browse 38 standalone examples across CLI, library, and REST API application shapes.
CLI
Command-line examples showing how Helix can be used for Java CLI applications.
basic-cli
Helix Console Basic CLI Example
Library
Small Java applications showing focused Helix library usage without wrapping everything in a web service.
collections
Demonstrates how helix-collections helps track map access and retain historical values. Shows TrackingMap operation history and accessed keys, plus VersionedMap current and historical lookups.
concurrency-executor
Demonstrates how helix-concurrency wraps standard executors so HelixContext and MDC flow across async work. Shows execute(...), submit(...), invokeAll(...), and CompletableFuture.supplyAsync(..., helixExecutorService).
concurrency-processor
Demonstrates how helix-concurrency fire-and-forget processors handle single events and batches asynchronously. Shows a custom FireForgetProcessor, a custom BatchFireForgetProcessor, and the graceful vs immediate shutdown switch.
concurrency-rwlock
Demonstrates how helix-concurrency read/write lock helpers protect shared state and keyed resources. Shows ReadWriteLocked, ReadWriteStripedLocked, and both returning and void lock operations.
crypto
Demonstrates how the helix-crypto modules cover hashing, encryption, MAC validation, and shared-secret exchange. Shows helix-crypto-bcrypt, helix-crypto-aead, helix-crypto-mac, and helix-crypto-diffiehellman in one small workflow.
envopts
Demonstrates how helix-envopts parses ENV_OPTS and custom environment-variable names into JVM system properties. Shows simple flags, -Dkey=value pairs, quoted comma-delimited values, custom env-var names, and why the pattern is handy in Docker containers.
rules
Demonstrates how helix-rules supports several rule styles in one engine. Shows Java rules, DSL rules, SpEL rules, REST rules, YAML-loaded rules, and rule filtering.
REST API
Helix Spring Boot web-service examples showing the framework’s web, actuator, contract, and operational features.
actuator-bom
Demonstrates how a generated software bill of materials can be downloaded through the Helix BOM actuator endpoint. Shows the Helix SBOM plugin, the management-port download flow, and the response headers used for auditing.
actuator-info
Demonstrates how Helix service identity and metadata are exposed through the info actuator endpoint. Shows the management-port info contract, Helix-specific service fields, and custom helix.metadata.* entries.
actuator-metadata
Demonstrates how Helix metadata is exposed and updated through the metadata actuator endpoint. Shows property metadata from helix.metadata.*, runtime deployment metadata added through actuator, and the same metadata snapshot being visible in application code.
actuator-readiness
Demonstrates how Helix readiness is managed through the readiness actuator endpoint. Shows the management-port readiness contract, marking the instance out of service and back in service, and the corresponding readiness view from application code.
basic
The smallest representative Helix REST service. Demonstrates the standard Helix response envelope, request IDs, service/resource structure, and global exception handling.
cache-control
Demonstrates how Helix adds default cache headers to GET responses. Shows the default Cache-Control: max-age=1 policy, endpoint-level overrides, and that the filter only applies to GET responses.
cache-redis
Demonstrates how to cache application data in Redis with helix-cache-redis. Shows RedisCacheService, JedisPool, JSON value serialization, Redis key prefixes and TTLs, plus cache hits, misses, and explicit eviction.
contract-batch
Demonstrates how to use the Helix batch contracts for mixed-result processing. Shows BatchResponse, BatchFailure, contract-level SUCCESS / PARTIAL_SUCCESS / FAILURE, and item-level failures that stay inside the batch response instead of becoming top-level API exceptions.
contract-hateoas
Demonstrates how to use the Helix HATEOAS response contracts. Shows HateoasCollectionResponse, a custom resource extending HateoasResponse, and _links with navigation and action metadata.
contract-pagination
Demonstrates how to use the Helix offset and cursor pagination contracts. Shows HateoasOffsetPaginatedResponse, HateoasCursorPaginatedResponse, and the HATEOAS pagination links that help clients navigate to the next page.
custom-error-handler
Demonstrates how to implement a custom HelixErrorHandler and let the global Helix error handler delegate to it. Shows a Spring-managed handler bean, business-specific error mapping, and the standard Helix error envelope around the custom response.
custom-requestid
Demonstrates how to replace the default Helix request ID filter with a custom correlation ID strategy. Shows custom request ID generation, propagation through headers and the Helix envelope, global exception handling, and API mapping with helix-mapper.
date-header
Demonstrates how to enable the built-in Helix Date header filter. Shows Helix automatically adding the Date header and leaving an endpoint-specific override in place.
deprecation
Demonstrates how to mark an API deprecated with Helix and communicate migration details through response headers. Shows @ApiDeprecated, Deprecation and Sunset headers, and Link headers for deprecation docs and the successor endpoint.
enforce-appid
Demonstrates how to require callers to send AppId or X-AppId to a Helix service. Shows the built-in Helix AppId interceptor, success handling for both supported headers, and the global error envelope returned when the header is missing.
envelope
Demonstrates how response enveloping works in Helix services. Shows automatic enveloping, explicit ResponseEnvelope usage, and disabling automatic enveloping for one endpoint with @DisableResponseEnvelope.
etag
Demonstrates how to enable the built-in Helix shallow ETag filter. Shows the first GET returning an ETag, a follow-up If-None-Match request returning 304 Not Modified, and scoping the filter to selected URL patterns.
external-healthcheck
Demonstrates how to enable Helix external health checks and add a custom Spring health contributor. Shows the difference between detailed internal actuator health and the coarse external /health and /liveness endpoints.
featureflags-launchdarkly
Demonstrates how to evaluate LaunchDarkly feature flags through the Helix feature-flag client. Shows FeatureClient, FeatureContext, and the Helix properties used to point the LaunchDarkly starter at a real LaunchDarkly environment.
featureflags-props
Demonstrates how to evaluate feature flags from local application properties. Shows the properties-backed FeatureClient, feature.* toggle properties, default values for missing flags, and the tradeoff that request-level targeting is not supported.
featureflags-unleash
Demonstrates how to evaluate Unleash feature flags through the Helix feature-flag client. Shows the Unleash starter autoconfiguration, FeatureClient, FeatureContext, and the Helix properties used to point the SDK at an Unleash server.
killswitch
Demonstrates how to control the Helix kill switch through the actuator management port. Shows the management endpoint contract, Helix-enveloped actuator responses, and the standard 503 business error returned while traffic is blocked.
logging-endpointregistration
Demonstrates how to debug startup issues with Helix endpoint registration logging and PID logging. Shows the listener properties, the startup log lines they produce, and a small application route that the endpoint registration listener reports during boot.
logging-http
Demonstrates how to enable and configure Helix HTTP request and response logging. Shows header and query-parameter exclusion, response-header exclusion, and value redaction via helix-logstash.
method-override
Demonstrates how to enable the built-in Helix method-override filter. Shows a client sending POST with X-HTTP-Method-Override: DELETE so Helix routes the request to a delete endpoint.
metrics
Demonstrates how the built-in Helix HTTP metrics filter records standard request metrics. Shows those meters being inspected through the management metrics actuator endpoint.
okhttp
Demonstrates how to call downstream services with helix-okhttp. Shows OAuth client credentials, outbound logging, metadata propagation, request ID propagation, retry, SLA, tracing, and downstream metrics inspected through the management actuator.
partial-responses
Demonstrates how to enable Helix partial JSON responses. Shows the fields query parameter trimming a raw JSON document down to just the requested properties.
sanity-check
Demonstrates how to create a custom HelixSanityCheck. Shows startup failing when a required application-specific property is missing or invalid.
validation
Small Helix REST API example that shows how to use the validators provided by helix-validation.
Working With The Catalog
- List all examples from the shared examples build with
./gradlew -p examples listExamples --init-script "$(pwd)/helix.init.gradle". - Publish current Helix artifacts before building or running examples with
./gradlew -p examples publishExampleDependenciesToMavenLocal --init-script "$(pwd)/helix.init.gradle". - Build the full catalog with
./gradlew -p examples buildExamples --init-script "$(pwd)/helix.init.gradle".