idempotency

package
v1.0.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineIdempotencyKey

func DetermineIdempotencyKey(msg hermod.Message) string

DetermineIdempotencyKey returns a deterministic key for deduplication. Precedence: 1) metadata[idempotency_key] 2) message ID 3) empty string if none available (caller may decide behavior)

func EnsureIdempotencyID

func EnsureIdempotencyID(msg hermod.Message) (string, bool)

EnsureIdempotencyID ensures the message has a stable ID set for sinks that use the message ID as the natural idempotency key (e.g., SQL primary key, etc.). If no ID or idempotency key is present, it generates a UUID as a defensive backstop to ensure the message is traceable and uniquely identifiable. Returns the key and whether it was set on the message.

func IdempotencyRequired

func IdempotencyRequired() bool

IdempotencyRequired returns true if idempotency must be enforced (and missing keys should be reported). Controlled via HERMOD_IDEMPOTENCY_REQUIRED.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL