CAMEL-23173: Add camel-event component for subscribing to Camel events#21983
CAMEL-23173: Add camel-event component for subscribing to Camel events#21983
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
Nice, I might be overthinking it, @davsclaus @oscerd what about adding a kafka backed camel-event implementation? would that make sense? |
|
@Croway Good question! We considered this, but the route-based approach already covers the distributed use case naturally: // Publish events to Kafka (or any other transport)
from("event:RouteStarted,RouteStopped,ExchangeFailed")
.setBody(simple("${header.CamelEventType}: ${header.CamelEventRouteId}"))
.to("kafka:camel-events");
// Consume from another instance
from("kafka:camel-events")
.to("log:distributed-events");A built-in Kafka-backed implementation would face a fundamental problem: Using standard routes instead:
We'll add documentation examples showing this pattern. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ring-event The existing spring-event component uses org.apache.camel.component.event, causing a build conflict. Rename to org.apache.camel.component.camelevent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4411e2a to
b5e4990
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
One note is that the processing of the event is synchronous and using the same thread that the route is using. So this will then extend the total processing time if you route the events to something that takes longer time. You can of course just use wireTap in the camel route to route it async. |
…canning The gulp `symlink:asciidoc:others` task uses a `**` glob pattern to scan DSL module directories. During parallel CI builds, temp directories under `target/` (e.g. `templates-tmp87842628`) can appear and disappear while the glob is scanning, causing ENOENT race conditions. Exclude `**/target/**` from `gulp.src()` calls in both `createSymlinks` and `createExampleSymlinks` functions, since build output directories should never contain documentation source files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Good point @davsclaus — that's an important caveat. Since the We should add a documentation note highlighting this, with a from("event:ExchangeCompleted")
.wireTap("kafka:camel-events") // async - won't block the exchange thread
.end();I'll add this to the component docs. |
Summary
camel-eventcomponent (URI scheme:event) that allows users to subscribe to Camel internal events via routesEventNotifiermechanismfilterquery parameterExample Usage
Test plan