Class MongoDbEventPublication

java.lang.Object
org.springframework.modulith.events.mongodb.MongoDbEventPublication

class MongoDbEventPublication extends Object
A MongoDB Document to represent event publications.
Author:
Dmitry Belyaev, Björn Kieling
  • Field Details

    • id

      final UUID id
    • publicationDate

      final Instant publicationDate
    • listenerId

      final String listenerId
    • event

      final Object event
    • lastResubmissionDate

      final @Nullable Instant lastResubmissionDate
    • completionAttempts

      final int completionAttempts
    • completionDate

      @Nullable Instant completionDate
    • status

  • Constructor Details

    • MongoDbEventPublication

      MongoDbEventPublication(UUID id, Instant publicationDate, String listenerId, Object event, @Nullable Instant completionDate, @Nullable EventPublication.Status status, @Nullable Instant lastResubmissionDate, int completionAttempts)
      Creates a new MongoDbEventPublication for the given id, publication date, listener id, event and completion date.
      Parameters:
      id - must not be null.
      publicationDate - must not be null.
      listenerId - must not be null or empty.
      event - must not be null.
      completionDate - can be null.
  • Method Details

    • markCompleted

      MongoDbEventPublication markCompleted(Instant instant)
      Marks the publication as completed at the given Instant.
      Parameters:
      instant - must not be null.
      Returns:
      will never be null.