NewEvent

com.worxbend.persistence.repository.NewEvent
See theNewEvent companion class
object NewEvent

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
NewEvent.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def from(envelope: Envelope): Either[String, NewEvent]

The bridge from the domain.

The bridge from the domain.

Fails when the envelope carries no time: the CloudEvents spec makes time optional, but the partition key is NOT NULL and inventing a timestamp would file the event in a month it did not happen in. The caller — wolfram at ingest, cobalt at the DLQ boundary — is the layer that knows what to do about it.

Attributes

def of(occurredAt: OffsetDateTime, raw: Json): NewEvent

Hashes the canonical JSON rendering.

Hashes the canonical JSON rendering.

This is not a substitute for the wire bytes and does not pretend to be: jsonb already discards key order, insignificant whitespace and duplicate keys (ADR §12.4), so hashing the raw octets would produce a digest that could never be recomputed from what was stored. Hashing noSpaces gives a digest that can be recomputed from the stored row, which is what makes it useful for detecting silent corruption and cross-partition duplicates.

Attributes