Class JdbcProcessWorkerRunner
java.lang.Object
org.chenile.orchestrator.process.jdbc.JdbcProcessWorkerRunner
- All Implemented Interfaces:
org.springframework.boot.CommandLineRunner
public class JdbcProcessWorkerRunner
extends Object
implements org.springframework.boot.CommandLineRunner
Claims and runs JDBC work items. With a database per tenant each cycle visits every tenant named
by the
TenantSupplier, running as that tenant (TenantScope) so the claim and the
work reach its database; a failing tenant is logged and does not stop the others. Without tenants
it polls once per cycle, as before.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ObjectProvider<BatchService<?>> private static final org.slf4j.Loggerprivate final ObjectMapperprivate final JdbcProcessWorkerPropertiesprivate final JdbcProcessWorkerRepositoryprivate final TenantScopeprivate final TenantSupplier -
Constructor Summary
ConstructorsConstructorDescriptionJdbcProcessWorkerRunner(JdbcProcessWorkerRepository repository, JdbcProcessWorkerProperties properties, ObjectProvider<BatchService<?>> batchServiceProvider, ObjectMapper objectMapper, TenantSupplier tenantSupplier, TenantScope tenantScope) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanexecute(JdbcProcessWorkItem item) booleanOne item from every tenant's queue; true if any tenant had work.booleanvoid
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
repository
-
properties
-
batchServiceProvider
-
objectMapper
-
tenantSupplier
-
tenantScope
-
-
Constructor Details
-
JdbcProcessWorkerRunner
public JdbcProcessWorkerRunner(JdbcProcessWorkerRepository repository, JdbcProcessWorkerProperties properties, ObjectProvider<BatchService<?>> batchServiceProvider, ObjectMapper objectMapper, TenantSupplier tenantSupplier, TenantScope tenantScope)
-
-
Method Details
-
run
-
processEachTenant
public boolean processEachTenant()One item from every tenant's queue; true if any tenant had work. -
processOne
public boolean processOne() -
execute
-
CHENILE