As a user, I want to register interceptors for service task workers so I can add cross-cutting concerns without replacing the delivery layer
I maintainer di solito rispondono entro 1 giorno
@emaarco ci sta già lavorando.
Dal 12/3/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Scenario
I want to add cross-cutting concerns (logging, APM/OpenTelemetry tracing, auditing)
around every service task worker execution without having to replace the entire ExternalServiceTaskDelivery
bean or rely on Spring AOP (which cannot easily access TaskInformation and variables).
The library supports two registration paths:
- Annotation-based (
@ProcessEngineWorker) viaprocess-engine-worker - Manual — directly calling
TaskSubscriptionApi.subscribeForTask(SubscribeForTaskCmd(..., action: TaskHandler))
A solution must cover both paths.
Current Behaviour
There is no first-class interceptor concept. To intercept worker execution, users must either:
- Replace the entire
ExternalServiceTaskDeliverybean (large surface area, error-prone, engine-specific) - Use Spring AOP (hard or impossible to access
TaskInformation+ variables + topic name) - Implement a custom
ParameterResolutionStrategyorResultResolutionStrategy(worker-lib only, no lifecycle hooks)
Wanted Behaviour
A ServiceTaskInterceptor interface that allows users to register one or more Spring beans to be applied
around every service task execution — regardless of whether the subscription was created via
@ProcessEngineWorker or via a manual subscribeForTask() call.
Proposed API:
fun interface ServiceTaskInterceptor {
fun intercept(context: ServiceTaskInterceptorContext, chain: ServiceTaskInterceptorChain)
}
data class ServiceTaskInterceptorContext(
val taskInformation: TaskInformation,
val payload: Map<String, Any?>,
val taskDescriptionKey: String?,
val taskType: TaskType
)
fun interface ServiceTaskInterceptorChain {
fun proceed()
}
Example logging interceptor:
@Component
class LoggingServiceTaskInterceptor : ServiceTaskInterceptor {
private val log = LoggerFactory.getLogger(this::class.java)
override fun intercept(ctx: ServiceTaskInterceptorContext, chain: ServiceTaskInterceptorChain) {
log.info("Executing [{}] with {} variables", ctx.taskDescriptionKey, ctx.payload.size)
chain.proceed()
log.info("Completed [{}]", ctx.taskDesclingKey)
}
}
The right interception point is inside AbstractTaskSubscriptionApiImpl.subscribeForTask() — wrapping the
action TaskHandler before storing the TaskSubscriptionHandle. This makes it transparent to all delivery
implementations (pull or push) and covers both registration paths automatically. Interceptors are ordered
via @Order/Ordered. When no interceptors are registered, behaviour is identical to today (zero overhead).
Possible Workarounds
- Provide a custom
ExternalServiceTaskDeliverybean (engine-specific, complex, replaces entire delivery layer) - Spring AOP on
@ProcessEngineWorkermethods (does not work for manualTaskHandlerregistrations;TaskInformationand variables are not directly accessible as method parameters in all cases) - Custom
ParameterResolutionStrategy(worker-lib only, no pre/post hooks around the actual execution)
- Lingua principale
- Kotlin
- Stelle
- 25
- Fork
- 5
- Merge medio
- 2g 18h
- PR unite (30g)
- 8
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bpm-crafters/process-engine-api
-
Type: enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
bpm-crafters/process-engine-api#157 ·
I maintainer di solito rispondono entro 1 giorno
-
Execution Listener SupportApertaType: enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
bpm-crafters/process-engine-api#128 ·
I maintainer di solito rispondono entro 1 giorno
-
Type: enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
bpm-crafters/process-engine-api#3 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di bpm-crafters/process-engine-api
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
maplibre/maplibre-native-ffi#792 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MetrolistGroup/Metrolist#4435 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
sk2andy/candy-browser#292 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno