Class CompositeErrorReportPublisher

java.lang.Object
com.tnsai.observability.errors.CompositeErrorReportPublisher
All Implemented Interfaces:
ErrorReportPublisher

public final class CompositeErrorReportPublisher extends Object implements ErrorReportPublisher
Fan-out ErrorReportPublisher — invokes every wrapped publisher for each publish(ErrorReport) call. Used by ErrorReports to combine all SPI-discovered publishers into a single emission point.

Failure isolation: if one wrapped publisher throws, the exception is logged at WARN against SELF_LOGGER and the remaining publishers still get the report. The umbrella publisher contract requires implementations not to throw, but defensive isolation here protects against misbehaving consumer-supplied publishers (Sentry SDK hiccups, network partitions in pluggable sinks, etc.).

Order matters only for ordering of SLF4J emissions; the downstream sinks see the same report. This class makes no assumptions about ordering semantics.

Since:
0.5.0 (issue #86)
  • Constructor Details

  • Method Details

    • publish

      public void publish(ErrorReport report)
      Description copied from interface: ErrorReportPublisher
      Publish a single error report. Errors during publication must not propagate to the caller — the caller is already in an error path; an exception here would mask the original failure.
      Specified by:
      publish in interface ErrorReportPublisher
    • publishers

      public List<ErrorReportPublisher> publishers()
      Exposed for assertions / introspection — immutable copy.