Spring Boot Integration
Auto-configure a FlexiQ bean in Spring Boot 3 from flexiq.* properties.
Auto-configure a FlexiQ bean in Spring Boot 3 from flexiq.* properties.
The flexiq-spring starter auto-configures a FlexiQ bean for Spring Boot 3
applications.
implementation("org.byteveda:flexiq-spring:1.0.0")When the starter is on the classpath, FlexiQAutoConfiguration builds and
opens a client from your configuration and registers it as a singleton bean.
The bean's destroy method is close, so the client shuts down with the
application context.
flexiq:
url: postgres://localhost/flexiq # SQLite path, postgres:// or redis:// URL
pool-size: 8 # optional; omit for the backend default
namespace: my-app # optional; isolates this app's jobs in a shared storeInject it anywhere:
@Service
public class SignupService {
private final FlexiQ flexiq;
public SignupService(FlexiQ flexiq) {
this.flexiq = flexiq;
}
public void register(User user) {
flexiq.enqueue("send_welcome_email", user.email());
}
}| Property | Type | Default | Description |
|---|---|---|---|
flexiq.url | String | SQLite under .flexiq/ | Connection string — SQLite path, postgres://, or redis:// |
flexiq.pool-size | Integer | backend default | Connection-pool size |
flexiq.namespace | String | — | Namespace isolating this app's jobs in a shared store |
The auto-configuration backs off (@ConditionalOnMissingBean) when you define
your own FlexiQ bean — do that when you need middleware, codecs, or a custom
serializer:
@Bean(destroyMethod = "close")
FlexiQ flexiq(FlexiQProperties properties) {
FlexiQ flexiq = FlexiQ.builder().url(properties.getUrl()).open();
flexiq.use(new SentryMiddleware()); // configure freely
return flexiq;
}The starter configures only the client bean. Workers are yours to build and
start — construct one from the injected bean with flexiq.worker() (for
example in an ApplicationRunner or a SmartLifecycle bean) and register
your handlers on it.
Set flexiq.dashboard.enabled=true to auto-start a
DashboardServer bean over the
FlexiQ bean. It's stopped with the application context
(destroyMethod = "close") and backs off (@ConditionalOnMissingBean) if you
define your own DashboardServer bean.
flexiq:
url: postgres://localhost/flexiq
dashboard:
enabled: true
port: 8080
# auth-enabled: true # opt in to session auth; the dashboard serves openly by default
# token: ${DASH_TOKEN:} # legacy shared-token mode; overrides auth-enabled
# static-dir: /opt/flexiq/dashboard-static
# secure-cookies: true # false drops the Secure cookie attribute for local HTTP| Property | Type | Default | Description |
|---|---|---|---|
flexiq.dashboard.enabled | boolean | false | Auto-start the dashboard server |
flexiq.dashboard.port | int | 8081 | Bind port (0 for ephemeral); defaults off Spring Boot's own 8080 |
flexiq.dashboard.auth-enabled | boolean | false | Enable session auth (login/setup, CSRF, roles); off means the dashboard serves openly |
flexiq.dashboard.token | String | none | Legacy shared token gating /api/*; overrides auth-enabled |
flexiq.dashboard.static-dir | String | auto-discovered | Directory of a prebuilt SPA, overriding the jar's extracted copy |
flexiq.dashboard.secure-cookies | boolean | true | Drop the Secure cookie attribute for local HTTP development |
OAuth/OIDC env vars (FLEXIQ_DASHBOARD_OAUTH_*, see
SSO) and the admin bootstrap
(FLEXIQ_DASHBOARD_ADMIN_USER/_PASSWORD) are read the same way regardless
of Spring — they aren't Spring properties, and they only apply when
auth-enabled is set.