flowable/flowable-engine · error · FlowableException
Sending the event was interrupted
Error message
Sending the event was interrupted
What it means
In KafkaOperationsOutboundEventChannelAdapter.sendEvent, the Kafka producer send is awaited synchronously with .get(). If the waiting thread is interrupted, the adapter restores the interrupt flag and throws FlowableException("Sending the event was interrupted"). It indicates the publishing thread was interrupted while the Kafka send was in flight.
Solutions
- Investigate who interrupted the thread (shutdown hooks, job timeout, thread pool shutdown) via the wrapped InterruptedException cause.
- Ensure Kafka broker responsiveness so sends complete before timeouts/interrupts.
- Retry the event send in a fresh transaction/job after shutdown completes.
- Check delivery.timeout.ms / request.timeout.ms so slow sends fail deterministically instead of blocking until interrupted.
Example fix
null
Defensive patterns
Strategy: try-catch
Try / catch
try {
outboundEventBus.send(event);
} catch (FlowableException e) {
if ("Sending the event was interrupted".equals(e.getMessage())) {
Thread.currentThread().interrupt(); // restore flag if needed and reschedule
rescheduleSend(event);
} else { throw e; }
} Prevention
- Avoid interrupting job-executor threads during normal operation; use graceful shutdown
- Tune Kafka producer timeouts so sends do not hang until interrupted
- Retry event publication after shutdown completes
When it happens
Trigger: The thread executing sendEvent (e.g. a process engine job executor thread) receives Thread.interrupt() while blocked on kafkaOperations.send(producerRecord).get().
Common situations: Application shutdown/timeout cancelling an async job mid-send; executor shutdownNow() while a Kafka publish is pending; long broker latency causing a send to outlive a job timeout.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
Related errors
- Call was interrupted
- At least one of topics, topicPartitions or topicPattern…
- Cannot get process model: no current command context is…
- Channel definition cannot resolve as a String[] or a String
- Channel model in tenant has retry configuration but no…
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/197b30c87070e775.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/kafka/KafkaOperationsOutboundEventChannelAdapter.java:73
Object rawEvent = event.getBody();
Map<String, Object> headerMap = event.getHeaders();
List<Header> headers = new ArrayList<>();
for (String headerKey : headerMap.keySet()) {
Object headerValue = headerMap.get(headerKey);
if (headerValue != null) {
headers.add(new RecordHeader(headerKey, headerValue.toString().getBytes(StandardCharsets.UTF_8)));
}
}
Integer partition = partitionProvider == null ? null : partitionProvider.determinePartition(event);
Object key = messageKeyProvider == null ? null : messageKeyProvider.determineMessageKey(event);
ProducerRecord<Object, Object> producerRecord = new ProducerRecord<>(topic, partition, key, rawEvent, headers);
kafkaOperations.send(producerRecord).get();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new FlowableException("Sending the event was interrupted", e);
} catch (ExecutionException e) {
if (e.getCause() instanceof RuntimeException) {
throw (RuntimeException) e.getCause();
} else {
throw new FlowableException("failed to send event", e.getCause());
}
}
}
@Override
public void sendEvent(Object rawEvent, Map<String, Object> headerMap) {
throw new UnsupportedOperationException("Outbound processor should never call this");
}
}
View on GitHub (pinned to d6d39ce1c6)