CAMEL-24377: Add JSON support to CamelEvent - #25495
Open
atiaomar1978-hub wants to merge 2 commits into
Open
Conversation
- Add asJSon() and toJSon(int) to CamelEvent SPI - Implement structured JSON serialization in CamelEventJsonSupport - Wire JSON methods through abstract event base classes and service events - Use structured JSON in EventConsole instead of ad hoc toString fields - Add CamelEventJsonTest with coverage for context, exchange, route, step, service, and failure event types - Document JSON serialization in event-notifier.adoc Co-authored-by: Cursor Agent <noreply@cursor.com>
- Include exception details on ExchangeRedeliveryEvent JSON - Guard exception JSON serialization with defensive fallback - Add redelivery event JSON test coverage Co-authored-by: Cursor Agent <noreply@cursor.com>
Contributor
Author
Bugbot / Grok self-review — findings addressedAI-generated comment on behalf of atiaomar1978-hub (Cursor Agent) Review summary
Test coverage (
|
atiaomar1978-hub
marked this pull request as ready for review
August 14, 2026 15:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements CAMEL-24377: structured JSON serialization for
CamelEvent, similar to the existingBacklogEventMessageAPI used by Error Registry and Backlog Tracer.API
Added to
org.apache.camel.spi.CamelEvent:Map<String, Object> asJSon()— structured event metadata as a JSON-compatible mapString toJSon(int indent)— pretty-printed JSON stringImplementation
CamelEventJsonSupportincamel-basebuilds JSON for all standard event types (context, route, exchange, step, service, failure)EventConsolenow usesevent.asJSon()instead of ad hoctoString()fieldsJSON fields (examples)
type,eventClass,timestamp,messagecontextNamerouteId,routeGroup,fromEndpointUriexchangeId,fromRouteId,routeIdendpointUri,timeTaken(sent)exception(type, message, stackTrace)attempt,exceptionstepIdservice,contextNameTests
CamelEventJsonTestcovers context, exchange failed/sent/failure-handling/redelivery, route reloaded/restarting failure, step failed, and service startup failure events../mvnw -pl core/camel-core -am test -Dtest=CamelEventJsonTest -Dsurefire.failIfNoSpecifiedTests=falseDocumentation
Updated
docs/user-manual/modules/ROOT/pages/event-notifier.adocwith JSON serialization section.Tracking
AI-assisted contributions
AI-generated PR on behalf of atiaomar1978-hub (Cursor Agent)