Skip to content

Question why stacktrace of failed events is not persisted in EventPublicationRegistry #1698

@ClaudioWaldvogel

Description

@ClaudioWaldvogel

Hi Spring Modulith Team,

While building a UI around the event publication registry, we noticed that failed event executions currently do not persist the underlying exception / stacktrace together with the failed event. Having the failure reason directly available in the persisted event state would make troubleshooting much easier, as users would not need to search through distributed application logs to understand why an event failed.

Looking at the implementation in CompletionRegisteringAdvisor, it seems that the exception is available at the point where the event is marked as failed. So I was wondering if there was a specific design decision why the stacktrace (or at least the exception message) is intentionally not persisted alongside the failed event?
I think it could easily passed to org.springframework.modulith.events.core.EventPublicationRegistry#markFailed and be persisted in the org.springframework.modulith.events.core.EventPublicationRegistry.

Just curious about the rationale here — maybe there are concerns about storage size, serialization, performance, security, or portability that I am missing?

Cheers Claudio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions