Hermes MongoDB
    Preparing search index...

    Type Alias OutboxMessageModel<Event>Template

    MongoDB document model for outbox messages.

    This represents the structure of documents stored in the outbox collection. Each message is tracked with metadata for delivery and debugging.

    Event - The type of the domain event/message

    // Document in MongoDB outbox collection:
    {
    _id: ObjectId("507f1f77bcf86cd799439011"),
    occurredAt: ISODate("2024-01-15T10:30:00Z"),
    data: {
    type: "MedicineAssigned",
    patientId: "patient-123",
    medicineId: "med-456"
    },
    partitionKey: "default",
    sentAt: ISODate("2024-01-15T10:30:02Z") // Optional, only if saveTimestamps enabled
    }
    type OutboxMessageModel<Event> = {
        _id: ObjectId;
        data: Event;
        occurredAt: Date;
        partitionKey: string;
        sentAt?: Date;
    }

    Type Parameters

    • Event
    Index

    Properties

    _id: ObjectId

    MongoDB ObjectId uniquely identifying this message

    data: Event

    The actual domain event/message data

    occurredAt: Date

    Timestamp when the event was queued to the outbox

    partitionKey: string

    Partition key for horizontal scaling (default: 'default')

    sentAt?: Date

    Optional timestamp when message was successfully sent (only if saveTimestamps enabled)