package
1.4.4
Repository: https://github.com/threedotslabs/watermill.git
Documentation: pkg.go.dev

# Functions

CorrelationID adds correlation ID to all messages produced by the handler.
Duplicator is processing messages twice, to ensure that the endpoint is idempotent.
InstantAck makes the handler instantly acknowledge the incoming message, regardless of any errors.
MessageCorrelationID returns correlation ID from the message.
NewCircuitBreaker returns a new CircuitBreaker middleware.
NewIgnoreErrors creates a new IgnoreErrors middleware.
NewMapExpiringKeyRepository returns a memory store backed by a regular hash map protected by a [sync.Mutex].
NewMessageHasherAdler32 generates message hashes using a fast Adler-32 checksum of the [message.Message] body.
NewMessageHasherFromMetadataField looks for a hash value inside message metadata instead of calculating a new one.
NewMessageHasherSHA256 generates message hashes using a slower but more resilient hashing of the [message.Message] body.
NewThrottle creates a new Throttle middleware.
PoisonQueue provides a middleware that salvages unprocessable messages and published them on a separate topic.
PoisonQueueWithFilter is just like PoisonQueue, but accepts a function that decides which errors qualify for the poison queue.
RandomFail makes the handler fail with an error based on random chance.
RandomPanic makes the handler panic based on random chance.
Recoverer recovers from any panic in the handler and appends RecoveredPanicError with the stacktrace to any error returned from the handler.
SetCorrelationID sets a correlation ID for the message.
Timeout makes the handler cancel the incoming message's context after a specified time.

# Constants

CorrelationIDMetadataKey is used to store the correlation ID in metadata.
MessageHasherReadLimitMinimum specifies the least number of bytes of a [message.Message] are used for calculating their hash values using a [MessageHasher].
Metadata keys which marks the reason and context why the message was deemed poisoned.
Metadata keys which marks the reason and context why the message was deemed poisoned.
Metadata keys which marks the reason and context why the message was deemed poisoned.
Metadata keys which marks the reason and context why the message was deemed poisoned.

# Variables

ErrInvalidPoisonQueueTopic occurs when the topic supplied to the PoisonQueue constructor is invalid.

# Structs

CircuitBreaker is a middleware that wraps the handler in a circuit breaker.
Deduplicator drops similar messages if they are present in a [ExpiringKeyRepository].
DelayOnError is a middleware that adds the delay metadata to the message if an error occurs.
IgnoreErrors provides a middleware that makes the handler ignore some explicitly whitelisted errors.
RecoveredPanicError holds the recovered panic's error along with the stacktrace.
Retry provides a middleware that retries the handler if errors are returned.
Throttle provides a middleware that limits the amount of messages processed per unit of time.

# Interfaces

ExpiringKeyRepository is a state container for checking the existence of a key in a certain time window.

# Type aliases

MessageHasher returns a short tag that describes a message.