Versions in this module Expand all Collapse all v0 v0.0.1 Oct 15, 2026 Changes in this version + const DefaultCompactionInt + const DefaultMaxSegmentSize + const DefaultMaxSegments + const FWB2Magic + const FWB2Version + const FrameMagic + const FrameVersion + const GRPCMethodAck + const GRPCMethodCommitOffset + const GRPCMethodDeclareQueue + const GRPCMethodDeclareStream + const GRPCMethodDeclareTopic + const GRPCMethodHealth + const GRPCMethodMove + const GRPCMethodNack + const GRPCMethodPauseQueue + const GRPCMethodPoll + const GRPCMethodPublish + const GRPCMethodPurgeQueue + const GRPCMethodReadStream + const GRPCMethodRequest + const GRPCMethodResumeQueue + const GRPCMethodStats + const GRPCMethodSubscribe + const MQTTConnack + const MQTTConnect + const MQTTDisconnect + const MQTTPingreq + const MQTTPingresp + const MQTTPuback + const MQTTPubcomp + const MQTTPublish + const MQTTPubrec + const MQTTPubrel + const MQTTSuback + const MQTTSubscribe + const MQTTUnsuback + const MQTTUnsubscribe + const NativeAuthAnonymous + const NativeAuthMTLS + const NativeAuthToken + const NativeStatusErrProtocol + const NativeStatusForbidden + const NativeStatusSuccess + const NativeStatusThrottled + const NativeStatusUnauthorized + const NativeStreamMagic + const PermissionAdminAll + const PermissionBrokerRead + const PermissionConsumerBan + const PermissionConsumerControl + const PermissionConsumerPoll + const PermissionConsumerRead + const PermissionConsumerRegister + const PermissionConsumerUnban + const PermissionDLQRead + const PermissionDLQReplay + const PermissionMessageAck + const PermissionMessageMove + const PermissionMessageNack + const PermissionMessageRead + const PermissionNotification + const PermissionPublish + const PermissionQueueControl + const PermissionQueuePurge + const PermissionQueueRead + const PermissionQueueWrite + const PermissionRouteRead + const PermissionRouteWrite + const PermissionStreamCommit + const PermissionStreamRead + const PermissionStreamWrite + const PermissionTaskRead + const PermissionTaskWrite + const PermissionTopicRead + const PermissionTopicWrite + const SegmentMagic + const SegmentTrailerMagic + const SegmentVersion + const Version + var ErrBackpressure = errors.New("broker: backpressure limit reached") + var ErrBrokerUnavailable = errors.New("broker: unavailable") + var ErrCallbackFailed = errors.New("broker: callback failed") + var ErrCancelled = errors.New("broker: cancelled") + var ErrCircuitOpen = errors.New("cluster: circuit breaker open, write rejected") + var ErrClosed = errors.New("broker: closed") + var ErrConsumerBanned = errors.New("broker: consumer banned") + var ErrDuplicateMessage = errors.New("broker: duplicate message") + var ErrFrameEncrypted = errors.New("broker: frame encrypted") + var ErrInvalidConfig = errors.New("invalid configuration") + var ErrInvalidMessage = errors.New("broker: invalid message") + var ErrInvalidRange = errors.New("zerocopy: invalid segment range") + var ErrLeaseLost = errors.New("broker: lease lost") + var ErrMessageNotFound = errors.New("broker: message not found") + var ErrMessageTooLarge = errors.New("broker: message too large") + var ErrNoDestination = errors.New("broker: no route destination") + var ErrNoHandler = errors.New("broker: no handler") + var ErrNoSubscribers = errors.New("broker: no subscribers") + var ErrNotLeader = errors.New("broker: not leader") + var ErrOffsetConflict = errors.New("broker: committed stream offset changed") + var ErrOutOfOrderSequence = errors.New("out of order sequence: sequence number gap detected") + var ErrPaused = errors.New("broker: paused") + var ErrPermanent = errors.New("broker: permanent error") + var ErrProducerFenced = errors.New("producer fenced: epoch is older than current epoch") + var ErrPublishTimeout = errors.New("broker: publish timeout") + var ErrQueueNotFound = errors.New("broker: queue not found") + var ErrQuorumUnavailable = errors.New("broker: quorum unavailable") + var ErrRateLimited = errors.New("broker: rate limited") + var ErrRequestTimeout = errors.New("broker: request timeout") + var ErrStaleEpoch = errors.New("broker: stale leader epoch") + var ErrStopped = errors.New("broker: stopped") + var ErrStorageUnavailable = errors.New("broker: storage unavailable") + var ErrStreamNotFound = errors.New("broker: stream not found") + var ErrThrottled = errors.New("broker: throttled") + var ErrTopicNotFound = errors.New("broker: topic not found") + var ErrTransactionAborted = errors.New("broker: transaction aborted") + var ErrTransactionClosed = errors.New("broker: transaction closed") + var ErrUnauthenticated = errors.New("broker: unauthenticated") + var ErrUnauthorized = errors.New("broker: unauthorized") + var ErrUnsupportedMode = errors.New("broker: unsupported mode") + func CompressPayload(codec CompressionCodec, data []byte) ([]byte, error) + func DecompressPayload(codec CompressionCodec, data []byte) ([]byte, error) + func EncodeAckFrameBatch(dst []byte, requests []AckRequest) []byte + func EncodeMessageFrameBatch(dst []byte, codec FrameCodec, messages []Message) ([]byte, error) + func ErrorCode(err error) string + func FrameFingerprint(b []byte) string + func HTTPStatusForError(err error) int + func IntPtr(v int) *int + func IsBinaryFrame(b []byte) bool + func IsPermanent(err error) bool + func LogNotifications(bus *NotificationBus, id string, includeDebug bool) + func NotLeaderError(leader string, epoch uint64) error + func PartitionedTopicName(topic string, partition int) string + func Permanent(err error) error + func RecoverFromAllSegments(dir string, store *MemoryStore) error + func ReplaySegment(path string, store *MemoryStore) error + func SendSegmentRange(conn net.Conn, file *os.File, offset, count int64) (int64, error) + func SentinelForCode(code string) (error, bool) + func SpanIDFromContext(ctx context.Context) string + func StaleEpochError(current uint64) error + func TopicMatch(pattern, subject string) bool + func TraceIDFromContext(ctx context.Context) string + func VisitFetchRaw(raw []byte, fn func([]byte) error) error + func WithAdminPrincipal(ctx context.Context, p AdminPrincipal) context.Context + func WriteBrokerError(w http.ResponseWriter, err error) + type ACL struct + Tokens []AdminToken + func NewACL(tokens ...AdminToken) *ACL + func (a *ACL) AddToken(token AdminToken) + func (a *ACL) Admit(principal AdminPrincipal) (func(), error) + func (a *ACL) AdmitConnection(principal AdminPrincipal) (func(), error) + func (a *ACL) Authenticate(raw string) (AdminPrincipal, bool) + func (a *ACL) AuthenticateCertificate(cert *x509.Certificate) (AdminPrincipal, bool) + func (a *ACL) Authorize(p AdminPrincipal, permission string) bool + func (a *ACL) Revoke(name string) bool + type AckMode string + const AckAuto + const AckManual + type AckPolicy string + const AckAll + const AckLeader + const AckNone + const AckProcessed + const AckQuorum + type AckRequest struct + ConsumerID string + LeaseToken string + MessageID string + Queue string + type AdminAuditEvent struct + Action string + Allowed bool + Method string + Path string + Principal string + Reason string + RemoteAddr string + Status int + Time time.Time + type AdminAuditLogger interface + LogAdmin func(context.Context, AdminAuditEvent) + type AdminPrincipal struct + Burst int + MaxConcurrent int + Name string + Permissions []string + RequestsPerSecond int + Tenants []string + Token string + func AdminPrincipalFromContext(ctx context.Context) (AdminPrincipal, bool) + func (p AdminPrincipal) HasPermission(perm string) bool + type AdminServer struct + ACL *ACL + AllowedOrigins []string + Audit AdminAuditLogger + Broker *Broker + ClientCAFile string + IdleTimeout time.Duration + InsecureDev bool + MaxBodyBytes int64 + ReadHeaderTimeout time.Duration + ReadTimeout time.Duration + RequireClientCert bool + TLSCertFile string + TLSKeyFile string + Token string + WriteTimeout time.Duration + func (a AdminServer) GracefulShutdown(ctx context.Context, srv *http.Server, drainTimeout time.Duration) error + func (a AdminServer) HTTPServer(addr string) *http.Server + func (a AdminServer) Handler() http.Handler + func (a AdminServer) ListenAndServe(addr string) *http.Server + func (a AdminServer) Shutdown(ctx context.Context, srv *http.Server) error + type AdminToken struct + Burst int + CertificateIdentities []string + ExpiresAt time.Time + MaxConcurrent int + Name string + Permissions []string + RequestsPerSecond int + Revoked bool + Tenants []string + Token string + type AppendEntry struct + Destinations []Destination + Message Message + type AtomicStore interface + AppendAtomic func(context.Context, []AppendEntry) ([]Message, error) + type AuditEvent struct + Action string + Detail string + Error string + ID string + Metadata map[string]any + Principal string + Resource string + Status string + TenantID string + Timestamp time.Time + type AuditLogger struct + func NewAuditLogger(capacity int) *AuditLogger + func (a *AuditLogger) AddSink(sink AuditSink) + func (a *AuditLogger) History(limit int) []AuditEvent + func (a *AuditLogger) Log(ctx context.Context, event AuditEvent) + func (a *AuditLogger) LogAck(ctx context.Context, principal, messageID, queue string, success bool) + func (a *AuditLogger) LogAuth(ctx context.Context, principal, action, resource string, allowed bool, ...) + func (a *AuditLogger) LogDLQ(ctx context.Context, principal, action, queue string, count int, success bool) + func (a *AuditLogger) LogMove(ctx context.Context, principal string, req MoveRequest, result MoveResult, ...) + func (a *AuditLogger) LogNack(ctx context.Context, principal, messageID, queue, action string, success bool) + func (a *AuditLogger) LogPublish(ctx context.Context, principal, messageID, topic, queue string, success bool) + func (a *AuditLogger) LogQueue(ctx context.Context, principal, action, queue string, success bool) + func (a *AuditLogger) LogSchema(ctx context.Context, principal, schema, version string, valid bool, ...) + func (a *AuditLogger) LogStream(ctx context.Context, principal, action, stream string, success bool) + type AuditSeverity string + const AuditCritical + const AuditInfo + const AuditWarn + type AuditSink interface + Write func(ctx context.Context, event AuditEvent) error + type BCLAction struct + Consumers []string + Queue string + Strategy string + Weight int + type BCLCondition struct + Field string + Operator string + Value string + type BCLPlanDefinition struct + Fallback string + Name string + Queue string + Rules []string + Strategy string + Topic string + type BCLPolicyDefinition struct + Config map[string]any + Name string + Type string + type BCLRoutingConfig struct + Description string + Plans []BCLPlanDefinition + Policies []BCLPolicyDefinition + Rules []BCLRuleDefinition + Strategies []BCLStrategyDefinition + Version string + type BCLRuleDefinition struct + Enabled bool + Name string + Priority int + Then BCLAction + When []BCLCondition + type BCLStrategyDefinition struct + Conditions []BCLCondition + Name string + Params map[string]any + Type StrategyType + type BackpressurePolicy string + const BackpressureBlock + const BackpressureDLQ + const BackpressureDropNewest + const BackpressureDropOldest + const BackpressureReject + const BackpressureSpillDisk + type BatchAckStore interface + AckBatch func(context.Context, []AckRequest) []error + type BatchHandler func(context.Context, []Delivery) error + type BatchPublishFuture interface + Cancel func(context.Context) error + Done func() <-chan struct{} + Wait func(context.Context) (BatchPublishResult, error) + type BatchPublishResult struct + Errors []string + Results []PublishResult + type BatchUpdateStore interface + UpdateBatch func(context.Context, []Message) []error + type BinaryFileWALStore struct + func NewBinaryFileWALStore(dir string, opts ...BinaryMessageCodecOption) (*BinaryFileWALStore, error) + func NewBinaryFileWALStoreWithCodec(dir string, codec FrameCodec) (*BinaryFileWALStore, error) + func NewBinaryFileWALStoreWithWALCodec(dir string, legacyCodec FrameCodec, walCodec *WALRecordCodec) (*BinaryFileWALStore, error) + func (*BinaryFileWALStore) ConfirmationLevel() ConfirmLevel + func (s *BinaryFileWALStore) Ack(ctx context.Context, req AckRequest) error + func (s *BinaryFileWALStore) AckBatch(ctx context.Context, reqs []AckRequest) []error + func (s *BinaryFileWALStore) Append(ctx context.Context, msg Message, dests []Destination) ([]Message, error) + func (s *BinaryFileWALStore) AppendAtomic(ctx context.Context, entries []AppendEntry) ([]Message, error) + func (s *BinaryFileWALStore) AppendAtomicMinimal(ctx context.Context, entries []AppendEntry) error + func (s *BinaryFileWALStore) AppendAtomicOwned(ctx context.Context, entries []AppendEntry) error + func (s *BinaryFileWALStore) Close() error + func (s *BinaryFileWALStore) CommitOffset(ctx context.Context, commit OffsetCommit) error + func (s *BinaryFileWALStore) CommitStreamTransaction(ctx context.Context, tx StreamTransaction) ([]Message, error) + func (s *BinaryFileWALStore) DeclareQueue(ctx context.Context, cfg QueueConfig) error + func (s *BinaryFileWALStore) DeclareStream(ctx context.Context, cfg StreamConfig) error + func (s *BinaryFileWALStore) DeclareTopic(ctx context.Context, cfg TopicConfig) error + func (s *BinaryFileWALStore) ExtendLease(ctx context.Context, req LeaseRequest) error + func (s *BinaryFileWALStore) Lease(ctx context.Context, req LeaseRequest) ([]Message, error) + func (s *BinaryFileWALStore) Move(ctx context.Context, req MoveRequest) (MoveResult, error) + func (s *BinaryFileWALStore) Nack(ctx context.Context, req NackRequest) error + func (s *BinaryFileWALStore) PauseQueue(ctx context.Context, name string) error + func (s *BinaryFileWALStore) PurgeQueue(ctx context.Context, name string) (int, error) + func (s *BinaryFileWALStore) ResumeQueue(ctx context.Context, name string) error + func (s *BinaryFileWALStore) SetHealthCallback(fn func(error)) + func (s *BinaryFileWALStore) StoreHealth() error + func (s *BinaryFileWALStore) SweepLeases(ctx context.Context, now time.Time) (int, error) + func (s *BinaryFileWALStore) Update(ctx context.Context, msg Message) error + func (s *BinaryFileWALStore) UpdateBatch(ctx context.Context, messages []Message) []error + type BinaryMessageCodec struct + CompressThreshold int + EncryptionKey []byte + MaxFrameSize int + SigningKey []byte + func NewBinaryMessageCodec(opts ...BinaryMessageCodecOption) *BinaryMessageCodec + func (c *BinaryMessageCodec) DecodeFrame(frame []byte, msg *Message) error + func (c *BinaryMessageCodec) DecodeMessage(frame []byte, msg *Message) error + func (c *BinaryMessageCodec) DecodeMessageBase64(s string, msg *Message) error + func (c *BinaryMessageCodec) EncodeFrame(dst []byte, typ FrameType, msg Message) ([]byte, error) + func (c *BinaryMessageCodec) EncodeMessage(dst []byte, msg Message) ([]byte, error) + func (c *BinaryMessageCodec) EncodeMessageBase64(msg Message) (string, error) + func (c *BinaryMessageCodec) PeekHeader(frame []byte, msg *Message) error + func (c *BinaryMessageCodec) WALCodecConfig() WALCodecConfig + type BinaryMessageCodecOption func(*BinaryMessageCodec) + func WithFrameCompressionThreshold(n int) BinaryMessageCodecOption + func WithFrameEncryptionKey(key []byte) BinaryMessageCodecOption + func WithFrameMaxSize(n int) BinaryMessageCodecOption + func WithFrameSigningKey(key []byte) BinaryMessageCodecOption + type Broker struct + func MustNew(cfg Config) *Broker + func New(cfg Config) (*Broker, error) + func (b *Broker) ACL() *ACL + func (b *Broker) AddRoute(route Route) + func (b *Broker) AddRoutingPlan(plan RoutingPlan) + func (b *Broker) AuditLogger() *AuditLogger + func (b *Broker) BanRemoteConsumer(ctx context.Context, id string, reason string) (ConsumerInfo, error) + func (b *Broker) CancelTask(ctx context.Context, id, reason string) error + func (b *Broker) Cluster() *Cluster + func (b *Broker) CommitOffset(ctx context.Context, commit OffsetCommit) error + func (b *Broker) ConfigLoader() *RoutingConfigLoader + func (b *Broker) ConsumerJoinGroup(ctx context.Context, consumerID, group string) *GroupState + func (b *Broker) ConsumerLeaveGroup(ctx context.Context, consumerID, group string) + func (b *Broker) ConsumerOffset(ctx context.Context, commit OffsetCommit) (uint64, error) + func (b *Broker) ConsumerOffsetManager() *ConsumerOffsetManager + func (b *Broker) Consumers() *ConsumerRegistry + func (b *Broker) DeclareQueue(ctx context.Context, cfg QueueConfig) error + func (b *Broker) DeclareStream(ctx context.Context, cfg StreamConfig) error + func (b *Broker) DeclareTopic(ctx context.Context, cfg TopicConfig) error + func (b *Broker) DefaultStrategy() StrategyType + func (b *Broker) FederationManager() *FederationManager + func (b *Broker) FrameCodec() FrameCodec + func (b *Broker) GetTask(ctx context.Context, id string) (TaskInfo, bool) + func (b *Broker) GroupRebalancer() *GroupRebalancer + func (b *Broker) Health() HealthStatus + func (b *Broker) HealthMonitor() *StoreHealthMonitor + func (b *Broker) IsStoreFenced() bool + func (b *Broker) ListTasks(ctx context.Context) []TaskInfo + func (b *Broker) ListTopic(ctx context.Context, name string, limit int) ([]Message, error) + func (b *Broker) LoadRoutingConfig(data []byte) error + func (b *Broker) MessageReplay() *MessageReplay + func (b *Broker) Metrics() BrokerMetrics + func (b *Broker) Notifications() *NotificationBus + func (b *Broker) OTLPExporter() *OTLPExporter + func (b *Broker) PartitionOrdering() *PartitionOrdering + func (b *Broker) PartitionReassignment() *PartitionReassignment + func (b *Broker) Pause(ctx context.Context) error + func (b *Broker) PauseQueue(ctx context.Context, name string) error + func (b *Broker) ProducerRegistry() *ProducerRegistry + func (b *Broker) PrometheusMetrics() *PrometheusMetrics + func (b *Broker) PublishRetryBuffer() *PublishRetryBuffer + func (b *Broker) Publisher() *Publisher + func (b *Broker) PurgeQueue(ctx context.Context, name string) (int, error) + func (b *Broker) QueueCandidates(queue, group string) []ConsumerCandidate + func (b *Broker) QueueMaxDepth(name string) int + func (b *Broker) ReadStream(ctx context.Context, req StreamReadRequest) ([]Message, error) + func (b *Broker) ReadTopic(ctx context.Context, name, afterID string, limit int) ([]Message, error) + func (b *Broker) RegisterRemoteConsumer(ctx context.Context, reg ConsumerRegistration) (ConsumerInfo, error) + func (b *Broker) RegisterTask(ctx context.Context, name string, handler TaskHandler, cfg ...ConsumerConfig) (*Subscription, error) + func (b *Broker) RemoteConsumerHeartbeat(ctx context.Context, id string) (ConsumerInfo, error) + func (b *Broker) RemoteConsumerSubscribe(ctx context.Context, id string, sub RemoteSubscription) (ConsumerInfo, error) + func (b *Broker) RemoveRoute(name string) bool + func (b *Broker) RemoveRoutingPlan(name string) + func (b *Broker) Resume(ctx context.Context) error + func (b *Broker) ResumeQueue(ctx context.Context, name string) error + func (b *Broker) RetryTask(ctx context.Context, id string) error + func (b *Broker) Router() *Router + func (b *Broker) SagaEngine() *SagaEngine + func (b *Broker) SelectConsumers(ctx context.Context, msg Message, candidates []ConsumerCandidate) ([]ConsumerCandidate, error) + func (b *Broker) SetACL(a *ACL) + func (b *Broker) SetDefaultStrategy(st StrategyType) + func (b *Broker) SetRemoteConsumerState(ctx context.Context, id string, st ConsumerState, reason string) (ConsumerInfo, error) + func (b *Broker) ShovelManager() *ShovelManager + func (b *Broker) Start(ctx context.Context) error + func (b *Broker) StartTime() time.Time + func (b *Broker) State() BrokerState + func (b *Broker) StateStore() StateStore + func (b *Broker) Stop(ctx context.Context) error + func (b *Broker) Store() Store + func (b *Broker) StreamHeadOffset(ctx context.Context, stream string) (uint64, error) + func (b *Broker) StreamLag(ctx context.Context, stream, consumerGroup string) (uint64, error) + func (b *Broker) StreamLagAll(ctx context.Context, stream string) (map[string]uint64, error) + func (b *Broker) StreamLagReport(ctx context.Context, stream string) (StreamConsumerLag, error) + func (b *Broker) StreamLogCompaction() *StreamLogCompaction + func (b *Broker) Subscribe(ctx context.Context, cfg ConsumerConfig, handler Handler) (*Subscription, error) + func (b *Broker) SubscribeBatch(ctx context.Context, cfg ConsumerConfig, handler BatchHandler) (*Subscription, error) + func (b *Broker) Task(id string) TaskHandle + func (b *Broker) TaskRouter() *TaskRouter + func (b *Broker) TenantManager() *TenantManager + func (b *Broker) TopicPartitionStats(ctx context.Context, topic string, partitions int) (*TopicPartitionStats, error) + func (b *Broker) Tracer() *Tracer + func (b *Broker) TransactionalOutbox() *TransactionalOutbox + func (b *Broker) UnbanRemoteConsumer(ctx context.Context, id string) (ConsumerInfo, error) + func (b *Broker) UnregisterRemoteConsumer(ctx context.Context, id string) error + type BrokerError struct + Code string + Details map[string]string + Message string + Retryable bool + Temporary bool + func (e BrokerError) Error() string + type BrokerEvent struct + Broker string + Error error + State BrokerState + Time time.Time + type BrokerMetrics struct + ActiveConsumers int + ActiveSubscriptions int + IsLeader bool + MessagesAcked uint64 + MessagesDeadLettered uint64 + MessagesDelivered uint64 + MessagesNacked uint64 + MessagesPublished uint64 + QueueCount int + RaftAppliedIndex uint64 + RaftCommitIndex uint64 + RaftState string + RaftTerm uint64 + StoreStats StoreStats + StreamCount int + TopicCount int + Uptime time.Duration + type BrokerState string + const BrokerConfigured + const BrokerDegraded + const BrokerDraining + const BrokerFailed + const BrokerInitializing + const BrokerPaused + const BrokerReady + const BrokerRecovering + const BrokerRunning + const BrokerStarting + const BrokerStopped + const BrokerStopping + type BrokerStateRecord struct + Metadata map[string]string + Mode Mode + Name string + NodeID string + State BrokerState + UpdatedAt time.Time + type BrokerStateStore interface + GetBrokerState func(context.Context, string) (BrokerStateRecord, bool, error) + PutBrokerState func(context.Context, BrokerStateRecord) error + type Callback interface + HandleNotification func(context.Context, Notification) error + type CallbackFunc func(context.Context, Notification) error + func (f CallbackFunc) HandleNotification(ctx context.Context, n Notification) error + type CircuitBreaker struct + func NewCircuitBreaker(cfg CircuitBreakerConfig) *CircuitBreaker + func (cb *CircuitBreaker) Allow() bool + func (cb *CircuitBreaker) IsOpen() bool + func (cb *CircuitBreaker) RecordFailure() + func (cb *CircuitBreaker) RecordSuccess() + func (cb *CircuitBreaker) Reset() + func (cb *CircuitBreaker) State() CircuitState + type CircuitBreakerConfig struct + HalfOpenMax int + SuccessThreshold int + Threshold int + Timeout time.Duration + type CircuitState string + const CircuitClosed + const CircuitHalfOpen + const CircuitOpen + type Cluster struct + func NewCluster(self string) *Cluster + func (c *Cluster) ActiveNodes() []ClusterNode + func (c *Cluster) Assign(topic string, partitions, replicas int) ([]PartitionAssignment, error) + func (c *Cluster) Assignment(topic string, partition int) (PartitionAssignment, bool) + func (c *Cluster) Assignments() []PartitionAssignment + func (c *Cluster) Drain(ctx context.Context, id string) error + func (c *Cluster) IsLeader() bool + func (c *Cluster) Join(ctx context.Context, node ClusterNode) error + func (c *Cluster) Leader() string + func (c *Cluster) Leave(ctx context.Context, id string) error + func (c *Cluster) MarkFailed(ctx context.Context, id string) error + func (c *Cluster) Nodes() []ClusterNode + func (c *Cluster) Self() string + type ClusterConfig struct + ClusterID string + Enabled bool + MinInSyncReplicas int + Peers []string + ReplicationFactor int + type ClusterNode struct + Address string + ID string + JoinedAt time.Time + Metadata map[string]string + State NodeState + UpdatedAt time.Time + Zone string + type Codec interface + ContentType func() string + Marshal func(any) ([]byte, error) + Unmarshal func([]byte, any) error + type CodecType string + const CodecFWB1 + const CodecFWB2 + type CompactCodecOption func(*CompactMessageCodec) + func WithCompactCompressThreshold(n int) CompactCodecOption + func WithCompactEncryptionKey(key []byte) CompactCodecOption + func WithCompactMaxFrameSize(n int) CompactCodecOption + func WithCompactSigningKey(key []byte) CompactCodecOption + type CompactMessageCodec struct + CompressThreshold int + EncryptionKey []byte + MaxFrameSize int + SigningKey []byte + func NewCompactMessageCodec(opts ...CompactCodecOption) *CompactMessageCodec + func (c *CompactMessageCodec) DecodeMessage(frame []byte, msg *Message) error + func (c *CompactMessageCodec) EncodeMessage(dst []byte, msg Message) ([]byte, error) + func (c *CompactMessageCodec) WALCodecConfig() WALCodecConfig + type CompactableStore interface + CompactableMessages func(ctx context.Context) ([]string, error) + RemoveMessages func(ctx context.Context, ids []string) error + type CompressionCodec byte + const CompressionLZ4 + const CompressionNone + const CompressionZstd + func ParseCompressionCodec(s string) (CompressionCodec, error) + func (c CompressionCodec) String() string + type Config struct + ACL *ACL + AuditEnabled bool + Backpressure BackpressurePolicy + Codec Codec + DefaultDLQ string + DefaultQueue string + DefaultRetry RetryPolicy + DefaultVisibility time.Duration + DrainTimeout time.Duration + EnableConsumerEventTracking bool + EnableNotifications bool + EnablePrometheus bool + EnablePublisherTracking bool + EnableRequestResponse bool + EnableTaskTracking bool + EnableTracing bool + EncryptionKey []byte + ExactlyOnce *ExactlyOnceConfig + FrameCodec FrameCodec + FrameCodecType CodecType + Hooks Hooks + LeaseSweepInterval time.Duration + MaxMessageSize int + MessageHistory *int + Mode Mode + Name string + NodeID string + NotificationHistoryCapacity int + OTLPEndpoint string + OTLPHeaders map[string]string + OTLPInterval time.Duration + OwnPool bool + Partition *PartitionConfig + PerformanceProfile PerformanceProfile + PollInterval time.Duration + Pool *pool.Pool + RateLimit *RateLimitConfig + RemoteConsumerTimeout time.Duration + SchemaRegistry SchemaRegistry + SigningKey []byte + StateStore StateStore + Store Store + Tenancy *TenancyConfig + TracerConfig *TracerConfig + WebSocket *WebSocketConfig + type ConfigWatcher struct + func NewConfigWatcher(b *Broker, filePath string, pollInterval time.Duration) *ConfigWatcher + func (cw *ConfigWatcher) ApplyConfig(ctx context.Context, dc DynamicConfig) error + func (cw *ConfigWatcher) Reload(ctx context.Context) error + func (cw *ConfigWatcher) Start(ctx context.Context) + func (cw *ConfigWatcher) Stop() + type ConfirmLevel string + const ConfirmAccepted + const ConfirmCommitted + const ConfirmDelivered + const ConfirmEnqueued + const ConfirmPersisted + const ConfirmProcessed + const ConfirmReplicated + const ConfirmRouted + const ConfirmValidated + type ConfirmationStore interface + ConfirmationLevel func() ConfirmLevel + type ConsoleAuditSink struct + func (s ConsoleAuditSink) Write(_ context.Context, event AuditEvent) error + type ConsoleExporter struct + Prefix string + func NewConsoleExporter() *ConsoleExporter + func (e *ConsoleExporter) ExportSpan(_ context.Context, span TraceSpan) error + func (e *ConsoleExporter) Flush(_ context.Context) error + type ConsumerCandidate struct + Acked int64 + AvgLatency time.Duration + Capabilities []string + ConsumerID string + Failed int64 + Group string + Healthy bool + InFlight int + LastLatency time.Duration + Leased int64 + MaxInFlight int + Metadata map[string]string + TenantID string + Weight int + func (c *ConsumerCandidate) LoadScore() float64 + func (c *ConsumerCandidate) SuccessRate() float64 + type ConsumerCommitMode string + const CommitAuto + const CommitBatched + const CommitManual + type ConsumerConfig struct + AckMode AckMode + BatchSize int + BatchWait time.Duration + Concurrency int + DLQ string + DeduplicationWindow time.Duration + FilterExpression string + FilterHeaders map[string]string + Group string + HeartbeatInterval time.Duration + Idempotent bool + MaxInFlight int + Name string + OrderBy OrderMode + Ordered bool + Pattern string + Priority int + Queue string + RetryPolicy RetryPolicy + Strategy StrategyType + StrategyConfig *StrategyConfig + Timeout time.Duration + Topic string + VisibilityTimeout time.Duration + type ConsumerDedup struct + func NewConsumerDedup(window time.Duration) *ConsumerDedup + func (d *ConsumerDedup) Cleanup() + func (d *ConsumerDedup) IsDuplicate(msg Message) bool + type ConsumerEvent struct + Consumer string + Error error + Group string + Queue string + State ConsumerState + Time time.Time + type ConsumerFilter interface + Match func(msg Message) bool + func NewConsumerFilter(cfg ConsumerConfig) (ConsumerFilter, error) + type ConsumerInfo struct + Acked int64 + Banned bool + BannedReason string + Draining bool + Failed int64 + InFlight int + LastError string + LastHeartbeat time.Time + Leased int64 + Nacked int64 + Paused bool + RegisteredAt time.Time + State ConsumerState + Subscriptions []RemoteSubscription + type ConsumerOffsetManager struct + func NewConsumerOffsetManager(b *Broker) *ConsumerOffsetManager + func (om *ConsumerOffsetManager) CommitOffset(ctx context.Context, stream, group string, offset uint64) error + func (om *ConsumerOffsetManager) GetAllOffsets(stream string) map[string]uint64 + func (om *ConsumerOffsetManager) GetOffset(stream, group string) (uint64, bool) + func (om *ConsumerOffsetManager) Lag(ctx context.Context, stream, group string) (uint64, error) + type ConsumerRegistration struct + AckMode AckMode + Capabilities []string + CommandTypes []string + Concurrency int + ConsumerID string + Group string + HeartbeatEveryNS int64 + Hostname string + MaxInFlight int + Metadata map[string]string + Name string + Patterns []string + Queues []string + RequestSubjects []string + TaskTypes []string + TenantID string + Topics []string + Version string + VisibilityTimeout int64 + type ConsumerRegistry struct + func NewConsumerRegistry(capacity int) *ConsumerRegistry + func (r *ConsumerRegistry) AddEvent(id string, n Notification) + func (r *ConsumerRegistry) AddStats(id string, leased, acked, nacked, failed int64, lastErr string) + func (r *ConsumerRegistry) Ban(id string, reason string) (ConsumerInfo, bool) + func (r *ConsumerRegistry) Events(id, after string, limit int) []Notification + func (r *ConsumerRegistry) Get(id string) (ConsumerInfo, bool) + func (r *ConsumerRegistry) Heartbeat(id string) (ConsumerInfo, bool) + func (r *ConsumerRegistry) List() []ConsumerInfo + func (r *ConsumerRegistry) ListContext(ctx context.Context) []ConsumerInfo + func (r *ConsumerRegistry) Register(reg ConsumerRegistration) ConsumerInfo + func (r *ConsumerRegistry) SetState(id string, st ConsumerState, reason string) (ConsumerInfo, bool) + func (r *ConsumerRegistry) Subscribe(id string, sub RemoteSubscription) (ConsumerInfo, bool) + func (r *ConsumerRegistry) Unban(id string) (ConsumerInfo, bool) + func (r *ConsumerRegistry) Unregister(id string) (ConsumerInfo, bool) + type ConsumerState string + const ConsumerAssigned + const ConsumerBackpressured + const ConsumerBanned + const ConsumerDisconnected + const ConsumerDraining + const ConsumerFailed + const ConsumerIdle + const ConsumerJoining + const ConsumerLeaving + const ConsumerPaused + const ConsumerPolling + const ConsumerProcessing + const ConsumerReady + const ConsumerRegistered + const ConsumerStopped + type ConsumerStateStore interface + AddConsumerEvent func(context.Context, string, Notification) error + ConsumerEvents func(context.Context, string, string, int) ([]Notification, error) + DeleteConsumer func(context.Context, string) error + GetConsumer func(context.Context, string) (ConsumerInfo, bool, error) + ListConsumers func(context.Context) ([]ConsumerInfo, error) + PutConsumer func(context.Context, ConsumerInfo) error + type ConsumerStrategy interface + Name func() StrategyType + Select func(ctx context.Context, msg Message, candidates []ConsumerCandidate) ([]ConsumerCandidate, error) + func NewAdaptiveLoadBalanceStrategy() ConsumerStrategy + func NewCapabilityBasedStrategy(requiredCaps []string) ConsumerStrategy + func NewConsistentHashStrategy(hashKey string) ConsumerStrategy + func NewFanOutStrategy() ConsumerStrategy + func NewHealthBasedStrategy() ConsumerStrategy + func NewLeastLoadedStrategy() ConsumerStrategy + func NewPowerOfTwoChoicesStrategy() ConsumerStrategy + func NewPriorityAwareStrategy(threshold int) ConsumerStrategy + func NewRandomStrategy() ConsumerStrategy + func NewRoundRobinStrategy() ConsumerStrategy + func NewRuleBasedStrategy(rules []RoutingRule) ConsumerStrategy + func NewShardedStrategy(hashKey string) ConsumerStrategy + func NewStickySessionStrategy(stickyKey string) ConsumerStrategy + func NewStrategy(cfg StrategyConfig) ConsumerStrategy + func NewWeightedRoundRobinStrategy() ConsumerStrategy + type DLQArchiveRequest struct + Destination string + DryRun bool + Limit int + type DLQArchiveResponse struct + Archived int + Destination string + DryRun bool + MessageIDs []string + Source string + type DLQDashboardResponse struct + QueueCount int + Queues []DLQQueueSummary + TotalDepth int + type DLQErrorCount struct + Count int + Error string + type DLQErrorInfo struct + Count int + Error string + FirstSeenAt *time.Time + LastSeenAt *time.Time + SampleMessageIDs []string + type DLQErrorsResponse struct + Errors []DLQErrorInfo + Limit int + Page int + Queue string + TotalErrors int + TotalMessages int + TotalPages int + type DLQEvent struct + Error error + Message Message + Queue string + Reason string + Time time.Time + type DLQQueueSummary struct + Depth int + LastError string + LastErrorAt *time.Time + Name string + OldestMessageAt *time.Time + TopErrors []DLQErrorCount + type DLQReplayAllRequest struct + BatchSize int + Destination string + DryRun bool + Mode MoveMode + type DLQReplayAllResponse struct + Batches int + Destination string + DryRun bool + MessageIDs []string + Replayed int + Source string + type Delivery struct + Message Message + func (d Delivery) Ack(ctx context.Context) error + func (d Delivery) Decode(out any) error + func (d Delivery) Extend(ctx context.Context, v time.Duration) error + func (d Delivery) Nack(ctx context.Context, opts ...NackOption) error + func (d Delivery) Progress(ctx context.Context, p Progress) error + func (d Delivery) Reject(ctx context.Context, reason string) error + func (d Delivery) Respond(ctx context.Context, response any, opts ...ResponseOption) error + func (d Delivery) RespondError(ctx context.Context, err error, opts ...ResponseOption) error + type Destination struct + Kind DestinationKind + Name string + type DestinationKind string + const DestinationArchive + const DestinationDLQ + const DestinationQueue + const DestinationStream + const DestinationTopic + type DistributedBroker struct + func NewDistributed(cfg Config, distCfg DistributedConfig) (*DistributedBroker, error) + func (db *DistributedBroker) AddNode(addr string) error + func (db *DistributedBroker) AddRaftNode(ctx context.Context, addr string) (uint64, error) + func (db *DistributedBroker) CanServeReads() bool + func (db *DistributedBroker) ClusterStats() map[string]any + func (db *DistributedBroker) DegradedMode() bool + func (db *DistributedBroker) HealthCheck() map[string]any + func (db *DistributedBroker) IsLeader() bool + func (db *DistributedBroker) Leader() string + func (db *DistributedBroker) RaftState() string + func (db *DistributedBroker) RemoveNode(id string) error + func (db *DistributedBroker) Start(ctx context.Context) error + func (db *DistributedBroker) Stop(ctx context.Context) error + func (db *DistributedBroker) SubmitToRaft(command []byte) (uint64, error) + type DistributedConfig struct + AllowExperimentalCustomRaft bool + AllowStaleReads bool + Cluster *cluster.Cluster + ControllerAddrs []string + ForwardTimeout time.Duration + JoinExisting bool + ListenAddr string + OnLeaderChange func(leader string) + OnNodeJoin func(nodeID string) + OnNodeLeave func(nodeID string) + OnStateChange func(state string) + Peers []string + RaftNodeID uint64 + RaftPeers map[uint64]string + ReplicationFactor int + SnapshotCatchUpEntries uint64 + SnapshotEntries uint64 + SubmitTimeout time.Duration + TLSConfig *tls.Config + UseEtcdRaft bool + WALDir string + type DistributedOpsServer struct + func NewDistributedOpsServer(cfg OpsConfig, dist *DistributedBroker) *DistributedOpsServer + func (s *DistributedOpsServer) Start() error + type DuplicateProducerSequenceError struct + Epoch int32 + MessageID string + ProducerID string + Sequence uint64 + func (e *DuplicateProducerSequenceError) Error() string + func (e *DuplicateProducerSequenceError) Unwrap() error + type DurabilityScope string + const DurabilityLocalFsync + const DurabilityMemory + const DurabilityQuorumFsync + type DurableOutbox struct + func NewDurableOutbox(cfg DurableOutboxConfig) (*DurableOutbox, error) + func (o *DurableOutbox) Enqueue(ctx context.Context, msg Message, dests []Destination) (string, error) + func (o *DurableOutbox) Flush(ctx context.Context) error + func (o *DurableOutbox) GetEntry(id string) (*DurableOutboxEntry, bool) + func (o *DurableOutbox) PendingCount() int + func (o *DurableOutbox) Start() error + func (o *DurableOutbox) Stop() error + type DurableOutboxConfig struct + BatchSize int + Broker *Broker + DeadLetterQueue string + DispatchTimeout time.Duration + MaxRetries int + PollInterval time.Duration + type DurableOutboxEntry struct + Attempts int + CreatedAt time.Time + Destinations []Destination + ID string + LastError string + MaxAttempts int + Message Message + PublishedAt *time.Time + Status DurableOutboxStatus + UpdatedAt time.Time + type DurableOutboxStatus string + const OutboxDeadLetter + const OutboxFailed + const OutboxInFlight + const OutboxPending + const OutboxPublished + type DynamicConfig struct + ACLTokens map[string][]string + Metadata map[string]string + RateLimits map[string]int + Routes []Route + func (dc *DynamicConfig) Validate() error + type ExactlyOnceConfig struct + ConsumerCommitMode ConsumerCommitMode + DeduplicationWindow time.Duration + Enabled bool + TransactionalOutbox bool + type ExpressionFilter struct + func ParseFilterExpression(raw string) (*ExpressionFilter, error) + func (ef *ExpressionFilter) Match(msg Message) bool + type FederationConfig struct + BatchSize int + Downstream string + Filter *FederationFilter + MaxInFlight int + PollInterval time.Duration + Queues []string + ReconnectDelay time.Duration + Topics []string + Transform *FederationTransform + Upstream string + type FederationFilter struct + Headers map[string]string + MinPriority int + Tenants []string + Types []string + type FederationLink struct + Config FederationConfig + Errors uint64 + ID string + Messages uint64 + StartedAt time.Time + State string + type FederationManager struct + func NewFederationManager(b *Broker) *FederationManager + func (fm *FederationManager) AddLink(cfg FederationConfig) *FederationLink + func (fm *FederationManager) ListLinks() []*FederationLink + func (fm *FederationManager) RemoveLink(id string) + func (fm *FederationManager) Stop() + type FederationTransform struct + AddHeaders map[string]string + PrefixTopic string + RemoveHeaders []string + RewriteQueue string + type FileWALStore struct + func NewFileWALStore(dir string) (*FileWALStore, error) + func NewFileWALStoreWithConfig(cfg FileWALStoreConfig) (*FileWALStore, error) + func (*FileWALStore) ConfirmationLevel() ConfirmLevel + func (s *FileWALStore) Ack(ctx context.Context, req AckRequest) error + func (s *FileWALStore) AckBatch(ctx context.Context, reqs []AckRequest) []error + func (s *FileWALStore) Append(ctx context.Context, msg Message, dests []Destination) ([]Message, error) + func (s *FileWALStore) AppendAtomic(ctx context.Context, entries []AppendEntry) ([]Message, error) + func (s *FileWALStore) AppendAtomicMinimal(ctx context.Context, entries []AppendEntry) error + func (s *FileWALStore) AppendAtomicOwned(ctx context.Context, entries []AppendEntry) error + func (s *FileWALStore) Close() error + func (s *FileWALStore) CommitOffset(ctx context.Context, commit OffsetCommit) error + func (s *FileWALStore) CommitStreamTransaction(ctx context.Context, tx StreamTransaction) ([]Message, error) + func (s *FileWALStore) DeclareQueue(ctx context.Context, cfg QueueConfig) error + func (s *FileWALStore) DeclareStream(ctx context.Context, cfg StreamConfig) error + func (s *FileWALStore) DeclareTopic(ctx context.Context, cfg TopicConfig) error + func (s *FileWALStore) ExtendLease(ctx context.Context, req LeaseRequest) error + func (s *FileWALStore) Lease(ctx context.Context, req LeaseRequest) ([]Message, error) + func (s *FileWALStore) Move(ctx context.Context, req MoveRequest) (MoveResult, error) + func (s *FileWALStore) Nack(ctx context.Context, req NackRequest) error + func (s *FileWALStore) PauseQueue(ctx context.Context, name string) error + func (s *FileWALStore) PurgeQueue(ctx context.Context, name string) (int, error) + func (s *FileWALStore) ResumeQueue(ctx context.Context, name string) error + func (s *FileWALStore) StoreHealth() error + func (s *FileWALStore) SweepLeases(ctx context.Context, now time.Time) (int, error) + func (s *FileWALStore) Update(ctx context.Context, msg Message) error + func (s *FileWALStore) UpdateBatch(ctx context.Context, messages []Message) []error + type FileWALStoreConfig struct + Dir string + EncryptionKey []byte + KeyName string + type FrameCodec interface + DecodeMessage func(frame []byte, msg *Message) error + EncodeMessage func(dst []byte, msg Message) ([]byte, error) + func NewFrameCodec(cfg FrameCodecConfig) FrameCodec + type FrameCodecConfig struct + CompressThreshold int + EncryptionKey []byte + MaxFrameSize int + SigningKey []byte + Type CodecType + type FrameFlags uint16 + const FrameFlagCompressed + const FrameFlagEncrypted + const FrameFlagHasHeaders + const FrameFlagHasMetadata + const FrameFlagRequest + const FrameFlagResponse + const FrameFlagSigned + const FrameFlagStreamEnd + const FrameFlagTask + type FrameHeader struct + CRC32C uint32 + Flags FrameFlags + HMACLen uint64 + HeaderLen uint64 + PayloadLen uint64 + Type FrameType + Version byte + func (h FrameHeader) String() string + type FrameType byte + const FrameConsumerEvent + const FrameHeartbeat + const FrameMessage + const FrameMessageAck + const FrameMessageAppend + const FrameMessageCopy + const FrameMessageDLQ + const FrameMessageExtend + const FrameMessageLease + const FrameMessageMove + const FrameMessageNack + const FrameOffsetCommit + const FrameTaskProgress + const FrameTaskResult + type GRPCConfig struct + BrokerToken string + ClientCAFile string + KeepAlive time.Duration + ListenAddr string + MaxConnections int + MaxMessageSize int + RequireClientCert bool + TLSCertFile string + TLSKeyFile string + type GRPCServer struct + func NewGRPCServer(b *Broker, cfg GRPCConfig) *GRPCServer + func (gs *GRPCServer) ListenAndServe() error + func (gs *GRPCServer) Stop() + type GRPCV1Config struct + ACL *ACL + InsecureDev bool + ListenAddr string + MaxMessageSize int + TLSConfig *tls.Config + type GRPCV1Server struct + func NewGRPCV1Server(b *Broker, cfg GRPCV1Config) (*GRPCV1Server, error) + func (s *GRPCV1Server) Ack(ctx context.Context, in *brokerv1.AckRequest) (*brokerv1.AckResponse, error) + func (s *GRPCV1Server) CommitOffset(ctx context.Context, in *brokerv1.CommitOffsetRequest) (*brokerv1.AckResponse, error) + func (s *GRPCV1Server) Health(context.Context, *brokerv1.HealthRequest) (*brokerv1.HealthResponse, error) + func (s *GRPCV1Server) ListenAndServe() error + func (s *GRPCV1Server) Nack(ctx context.Context, in *brokerv1.NackRequest) (*brokerv1.AckResponse, error) + func (s *GRPCV1Server) Poll(ctx context.Context, in *brokerv1.PollRequest) (*brokerv1.PollResponse, error) + func (s *GRPCV1Server) Publish(ctx context.Context, in *brokerv1.PublishRequest) (*brokerv1.PublishResponse, error) + func (s *GRPCV1Server) ReadStream(ctx context.Context, in *brokerv1.ReadStreamRequest) (*brokerv1.ReadStreamResponse, error) + func (s *GRPCV1Server) Serve(ln net.Listener) error + func (s *GRPCV1Server) Stop(ctx context.Context) error + type GroupAssignment struct + ConsumerID string + Group string + HashSlot uint32 + Partitions []int + TotalSlots int + Weight int + type GroupRebalancer struct + func NewGroupRebalancer() *GroupRebalancer + func NewGroupRebalancerWithHooks(hooks *RebalanceHooks) *GroupRebalancer + func (r *GroupRebalancer) ConsumerAssignment(consumerID, group string) *GroupAssignment + func (r *GroupRebalancer) GetGroup(group string) *GroupState + func (r *GroupRebalancer) JoinGroup(consumerID, group string) *GroupState + func (r *GroupRebalancer) JoinGroupWithWeight(consumerID, group string, weight int) *GroupState + func (r *GroupRebalancer) LeaveGroup(consumerID, group string) *GroupState + func (r *GroupRebalancer) ListGroups() []*GroupState + func (r *GroupRebalancer) ShouldLeaseForConsumer(consumerID, group string, messageKey string) bool + type GroupState struct + Assignments []GroupAssignment + Members []string + Name string + UpdatedAt time.Time + Version int + Weights map[string]int + type Handler func(context.Context, Delivery) error + type HeaderMatchFilter struct + Required map[string]string + func (f *HeaderMatchFilter) Match(msg Message) bool + type HealthCheck struct + Detail string + Name string + Status string + type HealthStatus struct + Checks []HealthCheck + Leader string + Mode Mode + NodeID string + State BrokerState + Status string + Store StoreStats + Uptime time.Duration + Version string + type Hooks struct + AfterAppend func(context.Context, StorageEvent) + AfterHandle func(context.Context, MessageEvent) + AfterPublish func(context.Context, PublishEvent) + AfterRoute func(context.Context, RoutingEvent) + BeforeAppend func(context.Context, StorageEvent) error + BeforeHandle func(context.Context, MessageEvent) error + BeforePublish func(context.Context, PublishEvent) error + BeforeRoute func(context.Context, RoutingEvent) error + OnAck func(context.Context, MessageEvent) + OnCircuitClosed func(context.Context, BrokerEvent) + OnCircuitOpen func(context.Context, BrokerEvent) + OnCommit func(context.Context, StorageEvent) + OnConsumerAssigned func(context.Context, ConsumerEvent) + OnConsumerBanned func(context.Context, ConsumerEvent) + OnConsumerDraining func(context.Context, ConsumerEvent) + OnConsumerPaused func(context.Context, ConsumerEvent) + OnConsumerRegistered func(context.Context, ConsumerEvent) + OnConsumerResumed func(context.Context, ConsumerEvent) + OnConsumerRevoked func(context.Context, ConsumerEvent) + OnConsumerStopped func(context.Context, ConsumerEvent) + OnConsumerUnbanned func(context.Context, ConsumerEvent) + OnCorruption func(context.Context, StorageEvent) + OnDLQArchive func(context.Context, DLQEvent) + OnDLQPurge func(context.Context, DLQEvent) + OnDLQReplay func(context.Context, DLQEvent) + OnDeadLettered func(context.Context, DLQEvent) + OnDegraded func(context.Context, BrokerEvent) + OnDraining func(context.Context, BrokerEvent) + OnFailed func(context.Context, BrokerEvent) + OnFsyncSlow func(context.Context, StorageEvent) + OnHandlerError func(context.Context, MessageEvent) + OnInitializing func(context.Context, BrokerEvent) + OnLeaseExtended func(context.Context, MessageEvent) + OnMaxRedeliveryExceeded func(context.Context, DLQEvent) + OnMessageCopied func(context.Context, MovementEvent) + OnMessageMoved func(context.Context, MovementEvent) + OnMessageRerouted func(context.Context, MovementEvent) + OnNack func(context.Context, MessageEvent) + OnPanic func(context.Context, MessageEvent) + OnPaused func(context.Context, BrokerEvent) + OnPublishConfirmed func(context.Context, PublishEvent) + OnPublishFailed func(context.Context, PublishEvent) + OnPublishRejected func(context.Context, PublishEvent) + OnRateLimited func(context.Context, MessageEvent) + OnReady func(context.Context, BrokerEvent) + OnRecovering func(context.Context, BrokerEvent) + OnRecoveryDone func(context.Context, StorageEvent) + OnRecoveryStart func(context.Context, StorageEvent) + OnResumed func(context.Context, BrokerEvent) + OnRetryDecision func(context.Context, RetryEvent) + OnRetryExhausted func(context.Context, RetryEvent) + OnRetryScheduled func(context.Context, RetryEvent) + OnRollback func(context.Context, StorageEvent) + OnRouteConflict func(context.Context, RoutingEvent) + OnRouteMiss func(context.Context, RoutingEvent) + OnStarted func(context.Context, BrokerEvent) + OnStopped func(context.Context, BrokerEvent) + OnTaskArchived func(context.Context, TaskEvent) + OnTaskCancelled func(context.Context, TaskEvent) + OnTaskCompensated func(context.Context, TaskEvent) + OnTaskCompensating func(context.Context, TaskEvent) + OnTaskCreated func(context.Context, TaskEvent) + OnTaskFailed func(context.Context, TaskEvent) + OnTaskProgress func(context.Context, TaskEvent) + OnTaskQueued func(context.Context, TaskEvent) + OnTaskRetrying func(context.Context, TaskEvent) + OnTaskScheduled func(context.Context, TaskEvent) + OnTaskStarted func(context.Context, TaskEvent) + OnTaskSucceeded func(context.Context, TaskEvent) + OnTaskTimedOut func(context.Context, TaskEvent) + type InMemoryExporter struct + func NewInMemoryExporter() *InMemoryExporter + func (e *InMemoryExporter) ExportSpan(_ context.Context, span TraceSpan) error + func (e *InMemoryExporter) Flush(_ context.Context) error + func (e *InMemoryExporter) Spans() []TraceSpan + type IndexEntry struct + Offset int64 + Seq uint64 + Time int64 + type IsolationLevel string + const IsolationQueuePrefix + const IsolationShared + const IsolationVHost + type JSONCodec struct + func (JSONCodec) ContentType() string + func (JSONCodec) Marshal(v any) ([]byte, error) + func (JSONCodec) Unmarshal(b []byte, v any) error + type LagAlert struct + ConsumerGroup string + CurrentLag uint64 + Level LagAlertLevel + Target string + Threshold uint64 + Timestamp time.Time + type LagAlertConfig struct + CheckInterval time.Duration + DefaultCritical uint64 + DefaultWarning uint64 + OnAlert func(alert LagAlert) + QueueThresholds map[string]LagThreshold + StreamThresholds map[string]LagThreshold + type LagAlertLevel string + const LagAlertCritical + const LagAlertWarning + type LagMonitor struct + func NewLagMonitor(b *Broker, cfg LagAlertConfig) *LagMonitor + func (lm *LagMonitor) ActiveAlerts() []LagAlert + func (lm *LagMonitor) CheckLag(ctx context.Context) ([]LagAlert, error) + func (lm *LagMonitor) Start(ctx context.Context) + func (lm *LagMonitor) Stop() + type LagThreshold struct + Critical uint64 + Warning uint64 + type LeaseRequest struct + Accept func(Message) bool + ConsumerGroup string + ConsumerID string + LeaseToken string + Limit int + MessageID string + Queue string + TenantID string + VisibilityTimeout time.Duration + type ListenerConfig struct + AMQP string + GRPC string + HTTP string + MQTT string + Native string + NativeRPC string + SSE string + WebSocket string + type MQTTConfig struct + ACL *ACL + BrokerToken string + ClientCAFile string + KeepAlive uint16 + ListenAddr string + MaxConnections int + MaxInflight int + MaxPacketSize int + Password string + RequireAuth bool + RequireClientCert bool + TLSCertFile string + TLSKeyFile string + Username string + type MQTTServer struct + func NewMQTTServer(b *Broker, cfg MQTTConfig) *MQTTServer + func (ms *MQTTServer) ListenAndServe() error + func (ms *MQTTServer) Stop() + type MQTTSession struct + ClientID string + Subscriptions map[string]uint8 + UpdatedAt time.Time + type MemoryQueueSnapshot struct + Config QueueConfig + Depth int + HasPriority bool + Head int + IDs []string + State QueueState + type MemorySchemaRegistry struct + func NewMemorySchemaRegistry(defs ...SchemaDefinition) *MemorySchemaRegistry + func (r *MemorySchemaRegistry) CheckCompatibility(name, newVersion, existingVersion string) SchemaCompatibility + func (r *MemorySchemaRegistry) DeprecateSchema(name, version string) error + func (r *MemorySchemaRegistry) GetSchema(name, version string) (SchemaDefinition, bool) + func (r *MemorySchemaRegistry) LatestVersion(name string) (string, bool) + func (r *MemorySchemaRegistry) ListVersions(name string) []SchemaDefinition + func (r *MemorySchemaRegistry) Register(d SchemaDefinition) error + func (r *MemorySchemaRegistry) RegisterContext(ctx context.Context, d SchemaDefinition) error + func (r *MemorySchemaRegistry) Validate(ctx context.Context, msg Message) error + type MemoryStateStore struct + func NewMemoryStateStore() *MemoryStateStore + func (s *MemoryStateStore) AddConsumerEvent(ctx context.Context, id string, n Notification) error + func (s *MemoryStateStore) Close() error + func (s *MemoryStateStore) ConsumerEvents(ctx context.Context, id, after string, limit int) ([]Notification, error) + func (s *MemoryStateStore) DeleteConsumer(ctx context.Context, id string) error + func (s *MemoryStateStore) DeleteTask(ctx context.Context, id string) error + func (s *MemoryStateStore) GetBrokerState(ctx context.Context, name string) (BrokerStateRecord, bool, error) + func (s *MemoryStateStore) GetConsumer(ctx context.Context, id string) (ConsumerInfo, bool, error) + func (s *MemoryStateStore) GetPublisherRecord(ctx context.Context, id string) (PublisherRecord, bool, error) + func (s *MemoryStateStore) GetTask(ctx context.Context, id string) (TaskInfo, bool, error) + func (s *MemoryStateStore) ListConsumers(ctx context.Context) ([]ConsumerInfo, error) + func (s *MemoryStateStore) ListPublisherRecords(ctx context.Context, limit int) ([]PublisherRecord, error) + func (s *MemoryStateStore) ListTasks(ctx context.Context, st TaskStatus, limit int) ([]TaskInfo, error) + func (s *MemoryStateStore) PutBrokerState(ctx context.Context, rec BrokerStateRecord) error + func (s *MemoryStateStore) PutConsumer(ctx context.Context, c ConsumerInfo) error + func (s *MemoryStateStore) PutPublisherRecord(ctx context.Context, rec PublisherRecord) error + func (s *MemoryStateStore) PutTask(ctx context.Context, t TaskInfo) error + type MemoryStore struct + func NewMemoryStore() *MemoryStore + func (*MemoryStore) ConfirmationLevel() ConfirmLevel + func (s *MemoryStore) Ack(ctx context.Context, req AckRequest) error + func (s *MemoryStore) AckBatch(ctx context.Context, reqs []AckRequest) []error + func (s *MemoryStore) Append(ctx context.Context, msg Message, dests []Destination) ([]Message, error) + func (s *MemoryStore) AppendAtomic(ctx context.Context, entries []AppendEntry) ([]Message, error) + func (s *MemoryStore) AppendAtomicMinimal(ctx context.Context, entries []AppendEntry) error + func (s *MemoryStore) AppendAtomicOwned(ctx context.Context, entries []AppendEntry) error + func (s *MemoryStore) Cleanup(maxHistoryPerMessage int) + func (s *MemoryStore) Close() error + func (s *MemoryStore) ColdMessages() int + func (s *MemoryStore) CommitOffset(ctx context.Context, commit OffsetCommit) error + func (s *MemoryStore) CommitStreamTransaction(ctx context.Context, tx StreamTransaction) ([]Message, error) + func (s *MemoryStore) CompactBacklogEnabled() bool + func (s *MemoryStore) ConsumerOffset(ctx context.Context, commit OffsetCommit) (uint64, error) + func (s *MemoryStore) DeclareQueue(ctx context.Context, cfg QueueConfig) error + func (s *MemoryStore) DeclareStream(ctx context.Context, cfg StreamConfig) error + func (s *MemoryStore) DeclareTopic(ctx context.Context, cfg TopicConfig) error + func (s *MemoryStore) ExtendLease(ctx context.Context, req LeaseRequest) error + func (s *MemoryStore) Get(ctx context.Context, id string) (Message, bool, error) + func (s *MemoryStore) History(ctx context.Context, id string) ([]MessageHistory, error) + func (s *MemoryStore) Lease(ctx context.Context, req LeaseRequest) ([]Message, error) + func (s *MemoryStore) ListDLQ(ctx context.Context, name string, limit int) ([]Message, error) + func (s *MemoryStore) ListQueue(ctx context.Context, name string, limit int) ([]Message, error) + func (s *MemoryStore) ListTopic(ctx context.Context, name string, limit int) ([]Message, error) + func (s *MemoryStore) Move(ctx context.Context, req MoveRequest) (MoveResult, error) + func (s *MemoryStore) Nack(ctx context.Context, req NackRequest) error + func (s *MemoryStore) PauseQueue(ctx context.Context, name string) error + func (s *MemoryStore) PurgeQueue(ctx context.Context, name string) (int, error) + func (s *MemoryStore) QueueReady(name string) <-chan struct{} + func (s *MemoryStore) ReadStream(ctx context.Context, req StreamReadRequest) ([]Message, error) + func (s *MemoryStore) ReadTopic(ctx context.Context, name, afterID string, limit int) ([]Message, error) + func (s *MemoryStore) Restore(snap MemoryStoreSnapshot) + func (s *MemoryStore) RestoreExact(snap MemoryStoreSnapshot) + func (s *MemoryStore) ResumeQueue(ctx context.Context, name string) error + func (s *MemoryStore) SetCompactBacklog(on bool) + func (s *MemoryStore) SetHistoryLimit(limit int) + func (s *MemoryStore) SetRetainCompleted(retain bool) + func (s *MemoryStore) Snapshot() MemoryStoreSnapshot + func (s *MemoryStore) Stats(ctx context.Context) (StoreStats, error) + func (s *MemoryStore) StreamHeadOffset(stream string) (uint64, error) + func (s *MemoryStore) StreamHeadOffsetContext(ctx context.Context, stream, tenantID string) (uint64, error) + func (s *MemoryStore) StreamLag(stream, consumerGroup string) (uint64, error) + func (s *MemoryStore) StreamLagAll(stream string) (map[string]uint64, error) + func (s *MemoryStore) StreamLagAllContext(ctx context.Context, stream, tenantID string) (map[string]uint64, error) + func (s *MemoryStore) StreamLagContext(ctx context.Context, stream, consumerGroup, tenantID string) (uint64, error) + func (s *MemoryStore) SweepLeases(ctx context.Context, now time.Time) (int, error) + func (s *MemoryStore) Update(ctx context.Context, msg Message) error + func (s *MemoryStore) UpdateBatch(ctx context.Context, messages []Message) []error + type MemoryStoreSnapshot struct + CreatedAt time.Time + Dedup map[string]time.Time + History map[string][]MessageHistory + Idemp map[string]string + Messages map[string]Message + MoveOps map[string]MoveResult + Offsets map[string]map[string]uint64 + Producers map[string]ProducerState + Queues map[string]MemoryQueueSnapshot + Streams map[string]MemoryStreamSnapshot + Topics map[string]MemoryTopicSnapshot + Version int + type MemoryStreamSnapshot struct + Config StreamConfig + IDs []string + Offset uint64 + type MemoryTopicSnapshot struct + Config TopicConfig + IDs []string + State QueueState + type Message struct + Attempts int + AvailableAt time.Time + CausationID string + Checksum string + ConsumerGroup string + ConsumerID string + ContentType string + CorrelationID string + CreatedAt time.Time + DeadLetterReason string + DeduplicationID string + ExpiresAt time.Time + Headers map[string]string + ID string + IdempotencyKey string + Key string + LastError string + LeaseToken string + LeaseUntil time.Time + MaxAttempts int + Metadata map[string]string + Offset uint64 + OriginalOffset uint64 + OriginalQueue string + OriginalStream string + OriginalTopic string + ParentID string + Partition int + Payload []byte + Priority int + ProducerEpoch int32 + ProducerID string + ProducerSequence *uint64 + Queue string + Redeliveries int + ReplyGroup string + ReplyTo string + RequestID string + RoutingKey string + Schema string + SchemaVersion string + SpanID string + Status MessageStatus + Stream string + TaskID string + TaskName string + TenantID string + Topic string + TraceID string + Type string + func DecodeMessageFrameBatch(data []byte, codec FrameCodec, maxMessages int) ([]Message, error) + type MessageEvent struct + Consumer string + Error error + Message Message + Queue string + Time time.Time + type MessageFilter struct + Headers map[string]string + Status MessageStatus + TenantID string + Type string + type MessageHistory struct + Actor string + Error string + Event string + MessageID string + Reason string + Source string + Status MessageStatus + Target string + Time time.Time + type MessageReplay struct + func NewMessageReplay(b *Broker) *MessageReplay + func (mr *MessageReplay) ReplayDLQ(ctx context.Context, dlqQueue, destQueue string) (MoveResult, error) + func (mr *MessageReplay) ReplayFromOffset(ctx context.Context, stream string, afterOffset uint64, limit int) ([]Message, error) + func (mr *MessageReplay) ReplayFromTime(ctx context.Context, stream string, since time.Time, limit int) ([]Message, error) + func (mr *MessageReplay) ReplayQueue(ctx context.Context, sourceQueue, destQueue string, limit int) (MoveResult, error) + type MessageStatus string + const MessageAccepted + const MessageAcked + const MessageArchived + const MessageAvailable + const MessageCancelled + const MessageCompleted + const MessageCopied + const MessageCreated + const MessageDeadLettered + const MessageDelivered + const MessageExpired + const MessageFailed + const MessageLeased + const MessageMoved + const MessageParked + const MessagePersisted + const MessageProcessing + const MessageProgressing + const MessagePurged + const MessageQuarantined + const MessageQueued + const MessageReplayed + const MessageRetryScheduled + const MessageRouted + const MessageScheduled + const MessageValidated + type MinimalAtomicStore interface + AppendAtomicMinimal func(context.Context, []AppendEntry) error + type Mode string + const ModeDistributed + const ModeEmbedded + const ModeStandalone + type MoveMode string + const MoveArchive + const MoveCopy + const MovePark + const MoveQuarantine + const MoveRemoveSource + const MoveReplay + const MoveReroute + type MoveRequest struct + Actor string + Destination string + DestinationType DestinationKind + DryRun bool + Filter MessageFilter + MessageIDs []string + Mode MoveMode + PreserveID bool + PreserveOffset bool + Reason string + ResetAttempts bool + ResetError bool + ResetLease bool + Source string + SourceType DestinationKind + type MoveResult struct + Copied int + Destination string + DryRun bool + MessageIDs []string + Moved int + Skipped int + type MovementEvent struct + Error error + Request MoveRequest + Result MoveResult + Time time.Time + type MultiExporter struct + func NewMultiExporter(exporters ...TraceExporter) *MultiExporter + func (m *MultiExporter) ExportSpan(ctx context.Context, span TraceSpan) error + func (m *MultiExporter) Flush(ctx context.Context) error + type NackAction string + const NackDLQ + const NackReject + const NackRequeue + const NackRetry + type NackOption func(*NackOptions) + func NackError(v string) NackOption + func NackReason(v string) NackOption + func NackToDLQ(v string) NackOption + func NackWithDelay(v time.Duration) NackOption + type NackOptions struct + Action NackAction + DLQ string + Delay time.Duration + Error string + Reason string + type NackRequest struct + Action NackAction + ConsumerID string + DLQ string + Delay time.Duration + Error string + IncrementAttempt bool + LeaseToken string + MessageID string + Queue string + Reason string + ResetLease bool + type NativeChannel struct + ID uint16 + func (ch *NativeChannel) Commit(stream, group string, partition int, offset uint64) error + func (ch *NativeChannel) Fetch(stream string, partition int, offset uint64, maxRecords, maxBytes int) ([][]byte, uint64, error) + func (ch *NativeChannel) Produce(stream string, partition int, payloads [][]byte) (uint64, error) + type NativeRPCConfig = GRPCConfig + type NativeRPCServer = GRPCServer + func NewNativeRPCServer(b *Broker, cfg NativeRPCConfig) *NativeRPCServer + type NativeStreamClient struct + func DialNativeStream(addr string, timeout time.Duration) (*NativeStreamClient, error) + func DialNativeStreamWithOptions(addr string, opts NativeStreamDialOptions) (*NativeStreamClient, error) + func (c *NativeStreamClient) Channel(id uint16) *NativeChannel + func (c *NativeStreamClient) Close() error + func (c *NativeStreamClient) Commit(stream, group string, partition int, offset uint64) error + func (c *NativeStreamClient) Fetch(stream string, partition int, offset uint64, maxRecords, maxBytes int) ([][]byte, uint64, error) + func (c *NativeStreamClient) FetchRaw(stream string, partition int, offset uint64, maxRecords, maxBytes int) ([]byte, int, uint64, error) + func (c *NativeStreamClient) Offset(stream, group string, partition int) (uint64, error) + func (c *NativeStreamClient) Principal() string + func (c *NativeStreamClient) Produce(stream string, partition int, payloads [][]byte) (uint64, error) + type NativeStreamConfig struct + ACL *ACL + Dir string + GroupCommitBytes int + GroupCommitDelay time.Duration + InsecureDev bool + MaxFrameBytes int + Partitions int + SegmentBytes int64 + Sync bool + TLSConfig *tls.Config + type NativeStreamDialOptions struct + AuthType byte + TLSConfig *tls.Config + Timeout time.Duration + Token string + type NativeStreamServer struct + func NewNativeStreamServer(cfg NativeStreamConfig) (*NativeStreamServer, error) + func (s *NativeStreamServer) Close() error + func (s *NativeStreamServer) ListenAndServe(addr string) error + type NodeConfig struct + AdvertiseAddr string + ID string + Rack string + Zone string + type NodeState string + const NodeActive + const NodeDraining + const NodeFailed + const NodeJoining + const NodeLeft + type Notification struct + Consumer string + ConsumerGroup string + Data map[string]any + ID string + MessageID string + Queue string + Severity Severity + Source string + Stream string + TaskID string + TenantID string + Timestamp time.Time + Topic string + TraceID string + Type string + type NotificationAuditLogger struct + Bus *NotificationBus + func (l NotificationAuditLogger) LogAdmin(ctx context.Context, e AdminAuditEvent) + type NotificationAuditSink struct + Bus *NotificationBus + func (s NotificationAuditSink) Write(ctx context.Context, event AuditEvent) error + type NotificationBus struct + func NewNotificationBus(capacity int) *NotificationBus + func (b *NotificationBus) Close() + func (b *NotificationBus) Enabled() bool + func (b *NotificationBus) History(limit int) []Notification + func (b *NotificationBus) Publish(n Notification) + func (b *NotificationBus) Subscribe(id string, cb Callback) + func (b *NotificationBus) Unsubscribe(id string) + type OTLPConfig struct + Client *http.Client + Endpoint string + Headers map[string]string + Interval time.Duration + ResourceAttributes map[string]string + ServiceName string + type OTLPExportRequest struct + ResourceMetrics []otlpResourceMetrics + type OTLPExporter struct + func NewOTLPExporter(endpoint string, interval time.Duration, metrics *PrometheusMetrics, ...) (*OTLPExporter, error) + func (e *OTLPExporter) Collect() *OTLPExportRequest + func (e *OTLPExporter) Export(ctx context.Context) error + func (e *OTLPExporter) Run(ctx context.Context) + func (e *OTLPExporter) Stop() + type OTLPOption func(*OTLPConfig) + func WithOTLPHTTPClient(client *http.Client) OTLPOption + func WithOTLPHeaders(headers map[string]string) OTLPOption + func WithOTLPResourceAttributes(attrs map[string]string) OTLPOption + func WithOTLPServiceName(name string) OTLPOption + type OffsetCommit struct + ConsumerGroup string + Offset uint64 + Stream string + TenantID string + type OpsConfig struct + Broker *Broker + ListenAddr string + type OpsServer struct + func NewOpsServer(cfg OpsConfig) *OpsServer + func (s *OpsServer) Start() error + func (s *OpsServer) Stop() error + type OrderMode string + const OrderFIFO + const OrderGlobal + const OrderKey + const OrderNone + const OrderPartition + const OrderTenant + type OutboxEvent struct + CreatedAt time.Time + Headers map[string]string + ID string + LastError string + Payload []byte + PublishedAt *time.Time + Queue string + RetryCount int + Status string + Topic string + type OwnedAtomicStore interface + AppendAtomicOwned func(context.Context, []AppendEntry) error + type PartitionAssignment struct + Leader string + Partition int + Replicas []string + Topic string + type PartitionConfig struct + Partitions int + Strategy PartitionStrategy + type PartitionInfo struct + Depth int + Name string + Offset uint64 + Partition int + type PartitionOrdering struct + func NewPartitionOrdering(b *Broker) *PartitionOrdering + func (po *PartitionOrdering) OrderedPublish(ctx context.Context, topic string, key string, payload any, ...) (PublishResult, error) + func (po *PartitionOrdering) OrderedSubscribe(ctx context.Context, cfg ConsumerConfig, handler Handler) (*Subscription, error) + func (po *PartitionOrdering) StreamOrderedPublish(ctx context.Context, stream string, partition int, key string, payload any, ...) (PublishResult, error) + func (po *PartitionOrdering) StreamOrderedRead(ctx context.Context, stream string, consumerGroup string, limit int) ([]Message, error) + type PartitionReassignment struct + func NewPartitionReassignment(b *Broker) *PartitionReassignment + func (pr *PartitionReassignment) AddRule(rule ReassignmentRule) + func (pr *PartitionReassignment) Execute(ctx context.Context) (int, error) + func (pr *PartitionReassignment) ListRules() []ReassignmentRule + func (pr *PartitionReassignment) RemoveRule(sourceTopic string) + func (pr *PartitionReassignment) StartReassignmentLoop(ctx context.Context, interval time.Duration) context.CancelFunc + type PartitionRouter struct + func NewPartitionRouter(cfg PartitionConfig) *PartitionRouter + func (pr *PartitionRouter) PartitionCount() int + func (pr *PartitionRouter) SelectPartition(msg Message) int + type PartitionStrategy string + const PartitionHash + const PartitionKey + const PartitionRandom + const PartitionRoundRobin + type PartitionedBinaryWALStore struct + func NewPartitionedBinaryWALStore(dir string, shardCount int, codec FrameCodec) (*PartitionedBinaryWALStore, error) + func (*PartitionedBinaryWALStore) ConfirmationLevel() ConfirmLevel + func (s *PartitionedBinaryWALStore) Ack(ctx context.Context, req AckRequest) error + func (s *PartitionedBinaryWALStore) AckBatch(ctx context.Context, reqs []AckRequest) []error + func (s *PartitionedBinaryWALStore) Append(ctx context.Context, msg Message, dests []Destination) ([]Message, error) + func (s *PartitionedBinaryWALStore) AppendAtomic(ctx context.Context, entries []AppendEntry) ([]Message, error) + func (s *PartitionedBinaryWALStore) AppendAtomicMinimal(ctx context.Context, entries []AppendEntry) error + func (s *PartitionedBinaryWALStore) AppendAtomicOwned(ctx context.Context, entries []AppendEntry) error + func (s *PartitionedBinaryWALStore) Close() error + func (s *PartitionedBinaryWALStore) CommitOffset(ctx context.Context, c OffsetCommit) error + func (s *PartitionedBinaryWALStore) CommitStreamTransaction(ctx context.Context, tx StreamTransaction) ([]Message, error) + func (s *PartitionedBinaryWALStore) ConsumerOffset(ctx context.Context, c OffsetCommit) (uint64, error) + func (s *PartitionedBinaryWALStore) DeclareQueue(ctx context.Context, cfg QueueConfig) error + func (s *PartitionedBinaryWALStore) DeclareStream(ctx context.Context, cfg StreamConfig) error + func (s *PartitionedBinaryWALStore) DeclareTopic(ctx context.Context, cfg TopicConfig) error + func (s *PartitionedBinaryWALStore) ExtendLease(ctx context.Context, req LeaseRequest) error + func (s *PartitionedBinaryWALStore) Get(ctx context.Context, id string) (Message, bool, error) + func (s *PartitionedBinaryWALStore) History(ctx context.Context, id string) ([]MessageHistory, error) + func (s *PartitionedBinaryWALStore) Lease(ctx context.Context, req LeaseRequest) ([]Message, error) + func (s *PartitionedBinaryWALStore) ListDLQ(ctx context.Context, name string, limit int) ([]Message, error) + func (s *PartitionedBinaryWALStore) ListQueue(ctx context.Context, name string, limit int) ([]Message, error) + func (s *PartitionedBinaryWALStore) ListTopic(ctx context.Context, name string, limit int) ([]Message, error) + func (s *PartitionedBinaryWALStore) Move(ctx context.Context, req MoveRequest) (MoveResult, error) + func (s *PartitionedBinaryWALStore) Nack(ctx context.Context, req NackRequest) error + func (s *PartitionedBinaryWALStore) PauseQueue(ctx context.Context, name string) error + func (s *PartitionedBinaryWALStore) PurgeQueue(ctx context.Context, name string) (int, error) + func (s *PartitionedBinaryWALStore) ReadStream(ctx context.Context, req StreamReadRequest) ([]Message, error) + func (s *PartitionedBinaryWALStore) ReadTopic(ctx context.Context, name, afterID string, limit int) ([]Message, error) + func (s *PartitionedBinaryWALStore) ResumeQueue(ctx context.Context, name string) error + func (s *PartitionedBinaryWALStore) SetHealthCallback(fn func(error)) + func (s *PartitionedBinaryWALStore) SetHistoryLimit(limit int) + func (s *PartitionedBinaryWALStore) SetRetainCompleted(retain bool) + func (s *PartitionedBinaryWALStore) ShardCount() int + func (s *PartitionedBinaryWALStore) Stats(ctx context.Context) (StoreStats, error) + func (s *PartitionedBinaryWALStore) StoreHealth() error + func (s *PartitionedBinaryWALStore) StreamHeadOffsetContext(ctx context.Context, stream, tenant string) (uint64, error) + func (s *PartitionedBinaryWALStore) StreamLagAllContext(ctx context.Context, stream, tenant string) (map[string]uint64, error) + func (s *PartitionedBinaryWALStore) StreamLagContext(ctx context.Context, stream, group, tenant string) (uint64, error) + func (s *PartitionedBinaryWALStore) SweepLeases(ctx context.Context, now time.Time) (int, error) + func (s *PartitionedBinaryWALStore) Update(ctx context.Context, msg Message) error + func (s *PartitionedBinaryWALStore) UpdateBatch(ctx context.Context, messages []Message) []error + type PerformanceProfile string + const ProfileDurable + const ProfileLatency + const ProfileLightweight + const ProfileThroughput + type PermanentError struct + Err error + func (e PermanentError) Error() string + func (e PermanentError) Unwrap() error + type PersistentWebhookConfig struct + CooldownDuration time.Duration + FailureThreshold int + HTTPClient *http.Client + InitialBackoff time.Duration + MaxAttempts int + MaxBackoff time.Duration + MaxHistoryPerURL int + type PersistentWebhookDispatcher struct + func NewPersistentWebhookDispatcher(cfg PersistentWebhookConfig) *PersistentWebhookDispatcher + func (d *PersistentWebhookDispatcher) CircuitState(url string) CircuitState + func (d *PersistentWebhookDispatcher) Dispatch(ctx context.Context, url string, n Notification) error + func (d *PersistentWebhookDispatcher) History(url string) []*WebhookAttempt + func (d *PersistentWebhookDispatcher) ReTrigger(ctx context.Context, url string, notificationID string) error + func (d *PersistentWebhookDispatcher) ResetCircuit(url string) + type PollRequest struct + ConsumerGroup string + ConsumerID string + Limit int + Queue string + TenantID string + VisibilityTimeoutNS int64 + WaitNS int64 + type Predicate func(msg Message) bool + type ProducerRegistry struct + func NewProducerRegistry() *ProducerRegistry + func (r *ProducerRegistry) CheckAndRecord(producerID string, epoch int32, seq uint64, msgID string) (isDuplicate bool, existingID string, err error) + func (r *ProducerRegistry) GetProducer(producerID string) (*ProducerState, bool) + func (r *ProducerRegistry) RegisterProducer(producerID string, epoch int32) (*ProducerState, error) + type ProducerState struct + Epoch int32 + Initialized bool + LastMessageID string + LastSequence uint64 + ProducerID string + UpdatedAt time.Time + type ProfileDefaults struct + Ack AckPolicy + NotificationRetention int + PollInterval time.Duration + Profile PerformanceProfile + Replication ReplicationPolicy + func DefaultsForProfile(profile PerformanceProfile) (ProfileDefaults, error) + type Progress struct + Current int64 + Message string + Percent float64 + Total int64 + UpdatedAt time.Time + type PrometheusMetrics struct + func GlobalPrometheusMetrics() *PrometheusMetrics + func NewPrometheusMetrics() *PrometheusMetrics + func (m *PrometheusMetrics) HookMetrics() Hooks + func (m *PrometheusMetrics) Middleware(next http.Handler) http.Handler + func (m *PrometheusMetrics) PromHandler() http.Handler + func (m *PrometheusMetrics) RecordAcked(queue string, latency time.Duration) + func (m *PrometheusMetrics) RecordDeadLettered(queue string) + func (m *PrometheusMetrics) RecordDelivered(queue string, size int, latency time.Duration) + func (m *PrometheusMetrics) RecordMoved() + func (m *PrometheusMetrics) RecordNacked(queue string) + func (m *PrometheusMetrics) RecordPublished(topic string, size int, latency time.Duration) + func (m *PrometheusMetrics) RecordRetried() + func (m *PrometheusMetrics) RecordStoreFenced() + func (m *PrometheusMetrics) SetActiveConsumers(n int) + func (m *PrometheusMetrics) SetActiveSubscriptions(n int) + func (m *PrometheusMetrics) UpdateGauges() + func (m *PrometheusMetrics) UpdateStoreStats(stats StoreStats) + type PublishBatchItem struct + Options []PublishOption + Payload any + Topic string + type PublishEvent struct + Destinations []Destination + Error error + Message Message + Result PublishResult + Time time.Time + type PublishFuture interface + Cancel func(context.Context) error + Done func() <-chan struct{} + ID func() string + Wait func(context.Context) (PublishResult, error) + type PublishHTTPPayload struct + CausationID string + ContentType string + CorrelationID string + DeduplicationID string + DeduplicationWindowNS int64 + DelayNS int64 + Headers map[string]string + IdempotencyKey string + Key string + MaxAttempts int + MessageID string + Metadata map[string]string + Payload json.RawMessage + PayloadEncoding string + Priority int + ProducerID string + Queue string + RoutingKey string + Schema string + SchemaVersion string + Strategy string + Stream string + TTLNS int64 + TenantID string + TimeoutNS int64 + Topic string + TraceID string + Type string + func (p *PublishHTTPPayload) UnmarshalJSON(data []byte) error + func (p PublishHTTPPayload) PayloadBytes() ([]byte, error) + func (p PublishHTTPPayload) PublishOptions() []PublishOption + type PublishOption func(*PublishOptions) + func WithCausationID(v string) PublishOption + func WithConfirmLevel(v ConfirmLevel) PublishOption + func WithContentType(v string) PublishOption + func WithCorrelationID(v string) PublishOption + func WithDeduplication(id string, window time.Duration) PublishOption + func WithDelay(v time.Duration) PublishOption + func WithHeader(k, v string) PublishOption + func WithHeaders(v map[string]string) PublishOption + func WithIdempotencyKey(v string) PublishOption + func WithKey(v string) PublishOption + func WithMaxAttempts(v int) PublishOption + func WithMessageID(v string) PublishOption + func WithMetadata(v map[string]string) PublishOption + func WithPriority(v int) PublishOption + func WithProducer(id string, epoch int32, seq uint64) PublishOption + func WithProducerEpoch(epoch int32) PublishOption + func WithProducerID(v string) PublishOption + func WithProducerSequence(seq uint64) PublishOption + func WithQueue(v string) PublishOption + func WithRequireDestination(v bool) PublishOption + func WithRetryPolicy(v RetryPolicy) PublishOption + func WithRoutingKey(v string) PublishOption + func WithRunAt(v time.Time) PublishOption + func WithSchema(name, version string) PublishOption + func WithStrategy(v StrategyType) PublishOption + func WithStream(v string) PublishOption + func WithTTL(v time.Duration) PublishOption + func WithTaskHeaders(id, name string) PublishOption + func WithTenantID(v string) PublishOption + func WithTraceID(v string) PublishOption + func WithType(v string) PublishOption + type PublishOptions struct + CausationID string + ConfirmLevel ConfirmLevel + ContentType string + CorrelationID string + DeduplicationID string + DeduplicationWindow time.Duration + Delay time.Duration + Headers map[string]string + IdempotencyKey string + Key string + MaxAttempts int + MessageID string + Metadata map[string]string + Priority int + ProducerEpoch int32 + ProducerID string + ProducerSequence *uint64 + Queue string + RequireDestination bool + RetryPolicy RetryPolicy + RoutingKey string + RunAt time.Time + Schema string + SchemaVersion string + Strategy StrategyType + Stream string + TTL time.Duration + TenantID string + TraceID string + Type string + type PublishResult struct + Confirmed ConfirmLevel + Destinations []Destination + Duplicate bool + Durability DurabilityScope + LeaderEpoch uint64 + MessageID string + Messages []Message + Offset uint64 + Partition int + Replicas int + type PublishRetryBuffer struct + func NewPublishRetryBuffer(b *Broker) *PublishRetryBuffer + func (to *PublishRetryBuffer) Cleanup(maxAge time.Duration) + func (to *PublishRetryBuffer) Pending() []OutboxEvent + func (to *PublishRetryBuffer) Publish(ctx context.Context, topic string, payload any, opts ...PublishOption) (PublishResult, error) + func (to *PublishRetryBuffer) RetryPending(ctx context.Context) (int, error) + type PublishTx interface + Commit func(context.Context) ([]PublishResult, error) + Publish func(topic string, payload any, opts ...PublishOption) error + Rollback func(context.Context) error + type Publisher struct + func (p *Publisher) BeginStreamTx(ctx context.Context, offset OffsetCommit, expectedOffset uint64) (PublishTx, error) + func (p *Publisher) BeginTx(ctx context.Context, opts ...TxOption) (PublishTx, error) + func (p *Publisher) Broadcast(ctx context.Context, topic string, payload any, opts ...PublishOption) (PublishResult, error) + func (p *Publisher) Command(ctx context.Context, command string, request any, response any, ...) error + func (p *Publisher) Publish(ctx context.Context, topic string, payload any, opts ...PublishOption) (PublishResult, error) + func (p *Publisher) PublishAfter(ctx context.Context, topic string, payload any, delay time.Duration, ...) (ScheduleResult, error) + func (p *Publisher) PublishAsync(ctx context.Context, topic string, payload any, opts ...PublishOption) PublishFuture + func (p *Publisher) PublishAt(ctx context.Context, topic string, payload any, at time.Time, ...) (ScheduleResult, error) + func (p *Publisher) PublishBatch(ctx context.Context, topic string, payloads []any, opts ...PublishOption) (BatchPublishResult, error) + func (p *Publisher) PublishBatchAsync(ctx context.Context, topic string, payloads []any, opts ...PublishOption) BatchPublishFuture + func (p *Publisher) PublishConfirm(ctx context.Context, topic string, payload any, opts ...PublishOption) (PublishResult, error) + func (p *Publisher) PublishItems(ctx context.Context, items []PublishBatchItem) (BatchPublishResult, error) + func (p *Publisher) PublishOwned(ctx context.Context, msg Message, opts ...PublishOption) (PublishResult, error) + func (p *Publisher) Request(ctx context.Context, subject string, request any, response any, ...) error + func (p *Publisher) RequestAsync(ctx context.Context, subject string, request any, opts ...RequestOption) ResponseFuture + func (p *Publisher) RequestStream(ctx context.Context, subject string, request any, opts ...RequestOption) (ResponseStream, error) + func (p *Publisher) SubmitTask(ctx context.Context, name string, payload any, opts ...TaskOption) (TaskHandle, error) + func (p *Publisher) SubmitTaskAsync(ctx context.Context, name string, payload any, opts ...TaskOption) TaskFuture + type PublisherRecord struct + CorrelationID string + CreatedAt time.Time + Error string + ID string + MessageID string + Metadata map[string]string + Operation string + Queue string + Status string + Stream string + Subject string + TaskID string + Topic string + UpdatedAt time.Time + type PublisherStateStore interface + GetPublisherRecord func(context.Context, string) (PublisherRecord, bool, error) + ListPublisherRecords func(context.Context, int) ([]PublisherRecord, error) + PutPublisherRecord func(context.Context, PublisherRecord) error + type QueueConfig struct + AckMode AckMode + Backpressure BackpressurePolicy + DLQ string + MaxDepth int + MaxInFlight int + Name string + Ordering OrderMode + RetryPolicy RetryPolicy + Strategy StrategyType + VisibilityTimeout time.Duration + Workers int + type QueueDepthReporter interface + type QueueRateLimiter struct + func NewQueueRateLimiter(cfg RateLimitConfig) *QueueRateLimiter + func (q *QueueRateLimiter) AllowQueue(queue string) bool + func (q *QueueRateLimiter) AllowTopic(topic string) bool + func (q *QueueRateLimiter) Stop() + type QueueSignaler interface + QueueReady func(name string) <-chan struct{} + type QueueState string + const QueueActive + const QueueArchived + const QueueBlocked + const QueueCreated + const QueueDeclared + const QueueDeleted + const QueueDraining + const QueueFull + const QueuePaused + const QueuePurged + type RFC6455Config struct + ACL *ACL + InsecureDev bool + MaxConnections int + MaxMessageSize int64 + OriginPatterns []string + Path string + ReadTimeout time.Duration + WriteTimeout time.Duration + type RFC6455Server struct + func NewRFC6455Server(b *Broker, cfg RFC6455Config) *RFC6455Server + func (s *RFC6455Server) ConnectionCount() int + func (s *RFC6455Server) Handler() http.Handler + func (s *RFC6455Server) Stop() + type RaftStateResponse struct + AppliedIndex uint64 + CommitIndex uint64 + IsLeader bool + Leader string + Peers []string + State string + Term uint64 + type RateLimitConfig struct + DefaultBurst int + DefaultRate int + PerQueue map[string]int + PerTopic map[string]int + type RateLimiter struct + func NewRateLimiter(ratePerSecond, burst int) *RateLimiter + func (rl *RateLimiter) Allow(key string) bool + func (rl *RateLimiter) AllowN(key string, n int) bool + func (rl *RateLimiter) Reset(key string) + func (rl *RateLimiter) Stop() + func (rl *RateLimiter) Wait(ctx context.Context, key string) error + func (rl *RateLimiter) WaitN(ctx context.Context, key string, n int) error + type RawCodec struct + func (RawCodec) ContentType() string + func (RawCodec) Marshal(v any) ([]byte, error) + func (RawCodec) Unmarshal(b []byte, v any) error + type ReassignmentRule struct + BatchSize int + DestTopic string + Enabled bool + Filter *MessageFilter + PreserveOffset bool + SourceTopic string + type RebalanceHooks struct + OnAfterRebalance func(group string, state *GroupState) + OnBeforeRebalance func(group string, oldMembers, newMembers []string) + OnDrainCompleted func(group, consumerID string) + OnDrainStarted func(group, consumerID string) + type RemoteError struct + Class RetryClassification + Code string + Details map[string]string + Message string + Retryable bool + Status int + func ParseRemoteError(status int, body []byte) *RemoteError + func (e *RemoteError) Error() string + func (e *RemoteError) RetryHint() (leader string, epoch uint64, retryAfter time.Duration) + func (e *RemoteError) Unwrap() error + type RemoteSubscription struct + AutoCreate bool + Name string + Pattern string + Queue string + Type string + type ReplicatedStore struct + func (s *ReplicatedStore) Ack(ctx context.Context, req AckRequest) error + func (s *ReplicatedStore) Append(ctx context.Context, msg Message, dests []Destination) ([]Message, error) + func (s *ReplicatedStore) AppendAtomic(ctx context.Context, entries []AppendEntry) ([]Message, error) + func (s *ReplicatedStore) CommitOffset(ctx context.Context, commit OffsetCommit) error + func (s *ReplicatedStore) ConfirmationLevel() ConfirmLevel + func (s *ReplicatedStore) ConsumerOffset(ctx context.Context, commit OffsetCommit) (uint64, error) + func (s *ReplicatedStore) DeclareQueue(ctx context.Context, cfg QueueConfig) error + func (s *ReplicatedStore) DeclareStream(ctx context.Context, cfg StreamConfig) error + func (s *ReplicatedStore) DeclareTopic(ctx context.Context, cfg TopicConfig) error + func (s *ReplicatedStore) ExtendLease(ctx context.Context, req LeaseRequest) error + func (s *ReplicatedStore) Get(ctx context.Context, id string) (Message, bool, error) + func (s *ReplicatedStore) History(ctx context.Context, id string) ([]MessageHistory, error) + func (s *ReplicatedStore) Lease(ctx context.Context, req LeaseRequest) ([]Message, error) + func (s *ReplicatedStore) ListDLQ(ctx context.Context, name string, limit int) ([]Message, error) + func (s *ReplicatedStore) ListQueue(ctx context.Context, name string, limit int) ([]Message, error) + func (s *ReplicatedStore) Move(ctx context.Context, req MoveRequest) (MoveResult, error) + func (s *ReplicatedStore) Nack(ctx context.Context, req NackRequest) error + func (s *ReplicatedStore) PauseQueue(ctx context.Context, name string) error + func (s *ReplicatedStore) PurgeQueue(ctx context.Context, name string) (int, error) + func (s *ReplicatedStore) ReadStream(ctx context.Context, req StreamReadRequest) ([]Message, error) + func (s *ReplicatedStore) ResumeQueue(ctx context.Context, name string) error + func (s *ReplicatedStore) Stats(ctx context.Context) (StoreStats, error) + func (s *ReplicatedStore) SweepLeases(ctx context.Context, now time.Time) (int, error) + func (s *ReplicatedStore) Update(ctx context.Context, message Message) error + func (s *ReplicatedStore) UpdateBatch(ctx context.Context, messages []Message) []error + type ReplicationPolicy struct + Acknowledgement AckPolicy + MinInSyncReplicas int + ReplicationFactor int + type RequestOption func(*RequestOptions) + func WithReplyTo(v string) RequestOption + func WithRequestCorrelationID(v string) RequestOption + func WithRequestHeader(k, v string) RequestOption + func WithRequestIdempotencyKey(v string) RequestOption + func WithRequestTenantID(v string) RequestOption + func WithRequireHandler(v bool) RequestOption + func WithTimeout(v time.Duration) RequestOption + type RequestOptions struct + ContentType string + CorrelationID string + Headers map[string]string + IdempotencyKey string + MaxResponseBytes int64 + ReplyTo string + RequireHandler bool + RetryPolicy RetryPolicy + TenantID string + Timeout time.Duration + type Response struct + CorrelationID string + Error *BrokerError + Headers map[string]string + MessageID string + Payload []byte + Status ResponseStatus + type ResponseFuture interface + Cancel func(context.Context) error + CorrelationID func() string + Done func() <-chan struct{} + RequestID func() string + Wait func(context.Context) (Response, error) + type ResponseOption func(*ResponseOptions) + func WithEndStream(v bool) ResponseOption + func WithResponseHeader(k, v string) ResponseOption + func WithResponseStatus(v ResponseStatus) ResponseOption + type ResponseOptions struct + EndStream bool + Headers map[string]string + Status ResponseStatus + type ResponseStatus string + const ResponseError + const ResponseOK + const ResponseTimeout + type ResponseStream interface + Close func() error + Err func() error + Message func() Response + Next func() bool + type RetryClassification string + const RetryNotLeader + const RetryQuorumUnavailable + const RetryStaleEpoch + const RetryStorageUnavailable + const RetryThrottled + const RetryTransactionAborted + func ClassifyRetry(err error) (RetryClassification, bool) + type RetryError struct + Cause error + Class RetryClassification + Leader string + LeaderEpoch uint64 + Message string + RetryAfter time.Duration + func (e *RetryError) Error() string + func (e *RetryError) Unwrap() error + type RetryEvent struct + Delay time.Duration + Error error + Message Message + Time time.Time + type RetryPolicy struct + Factor float64 + Initial time.Duration + Jitter bool + Max time.Duration + MaxAttempts int + func DefaultRetryPolicy() RetryPolicy + type Route struct + Capabilities []string + Condition func(Message) bool + CopyTo []Destination + Disabled bool + Enabled bool + Fallback StrategyType + HashKey string + Headers map[string]string + Match string + MaxStickyBindings int + Mode RouteMode + Name string + PriorityMin int + PriorityThreshold int + Rules []RoutingRule + StickyKey string + Strategy StrategyType + StrategyConfig *StrategyConfig + TenantID string + To []Destination + Weight int + type RouteMode string + const RouteAdaptive + const RouteCapabilityBased + const RouteConsistentHash + const RouteDLX + const RouteDelay + const RouteDirect + const RouteFanout + const RouteHeaders + const RouteLeastLoaded + const RouteP2C + const RoutePriority + const RouteRandom + const RouteRoundRobin + const RouteRules + const RouteSharded + const RouteSticky + const RouteStream + const RouteTopic + const RouteWeighted + type Router struct + func NewRouter() *Router + func (r *Router) Add(route Route) + func (r *Router) AddPlan(plan RoutingPlan) + func (r *Router) Clear() + func (r *Router) ConfigLoader() *RoutingConfigLoader + func (r *Router) LoadRoutingConfig(data []byte) error + func (r *Router) Remove(name string) bool + func (r *Router) RemovePlan(name string) + func (r *Router) RemovePrefix(prefix string) int + func (r *Router) Route(ctx context.Context, msg Message) ([]Destination, []Route) + func (r *Router) RouteWithStrategy(ctx context.Context, msg Message, candidates []ConsumerCandidate) ([]ConsumerCandidate, []Route, error) + func (r *Router) Routes() []Route + func (r *Router) TaskRouter() *TaskRouter + type RoutingConfig struct + DefaultStrategy StrategyType + GlobalHashKey string + Metadata map[string]string + Plans []RoutingPlan + func DefaultRoutingConfig() RoutingConfig + func ParseBCLConfig(bcl BCLRoutingConfig) (RoutingConfig, error) + type RoutingConfigLoader struct + func NewRoutingConfigLoader() *RoutingConfigLoader + func (l *RoutingConfigLoader) AddPlan(plan RoutingPlan) + func (l *RoutingConfigLoader) BuildStrategy(plan RoutingPlan) ConsumerStrategy + func (l *RoutingConfigLoader) GetConfig() RoutingConfig + func (l *RoutingConfigLoader) GetPlan(name string) (RoutingPlan, bool) + func (l *RoutingConfigLoader) GetPlanForQueue(queue string) (RoutingPlan, bool) + func (l *RoutingConfigLoader) GetPlanForTopic(topic string) (RoutingPlan, bool) + func (l *RoutingConfigLoader) LoadFromBytes(data []byte) error + func (l *RoutingConfigLoader) LoadFromFile(path string) error + func (l *RoutingConfigLoader) LoadFromMap(m map[string]any) error + func (l *RoutingConfigLoader) Registry() *StrategyRegistry + func (l *RoutingConfigLoader) RemovePlan(name string) bool + type RoutingEvent struct + Destinations []Destination + Error error + Message Message + Route Route + Time time.Time + type RoutingPlan struct + Capabilities []string + Enabled bool + Fallback StrategyType + HashKey string + MaxStickyBindings int + Name string + PriorityThreshold int + Queue string + Rules []RoutingRule + StickyKey string + Strategy StrategyType + Topic string + UpdatedAt time.Time + Weight int + type RoutingRule struct + Enabled bool + MatchHeaders map[string]string + MatchKeyPattern string + MatchPriority int + MatchTenantID string + MatchTopic string + MatchType string + Metadata map[string]string + Name string + Priority int + Strategy ConsumerStrategy + StrategyType StrategyType + TargetConsumers []string + Weight int + func (r *RoutingRule) Matches(msg Message) bool + type SSEConfig = WebSocketConfig + type SSEServer = WebSocketServer + func NewSSEServer(b *Broker, cfg SSEConfig) *SSEServer + type SagaDefinition struct + ID string + Metadata map[string]string + Name string + Steps []SagaStep + TenantID string + Timeout time.Duration + type SagaEngine struct + func NewSagaEngine(b *Broker) *SagaEngine + func (e *SagaEngine) CleanupSagas(maxAge time.Duration) int + func (e *SagaEngine) CreateSaga(ctx context.Context, def SagaDefinition) *SagaInstance + func (e *SagaEngine) CreateSagaChecked(ctx context.Context, def SagaDefinition) (*SagaInstance, error) + func (e *SagaEngine) ExecuteSaga(ctx context.Context, sagaID string) error + func (e *SagaEngine) GetSaga(id string) (SagaInstance, bool) + func (e *SagaEngine) GetSagaContext(ctx context.Context, id string) (SagaInstance, bool) + func (e *SagaEngine) ListSagas() []SagaInstance + func (e *SagaEngine) ListSagasByStatus(st SagaStatus) []SagaInstance + func (e *SagaEngine) ListSagasContext(ctx context.Context) []SagaInstance + type SagaInstance struct + CreatedAt time.Time + CurrentStep int + Error string + FinishedAt time.Time + ID string + Results []SagaStepResult + Status SagaStatus + UpdatedAt time.Time + type SagaStatus string + const SagaCompensated + const SagaCompensating + const SagaCompleted + const SagaCreated + const SagaExecuting + const SagaFailed + type SagaStep struct + Action SagaStepAction + Compensate SagaStepAction + Name string + Optional bool + type SagaStepAction struct + Metadata map[string]string + Payload any + Queue string + TaskName string + Timeout time.Duration + type SagaStepResult struct + CompletedAt time.Time + Error string + Result []byte + StartedAt time.Time + Status TaskStatus + StepName string + TaskID string + type ScheduleResult struct + MessageID string + RunAt string + ScheduleID string + type SchemaCompatibility string + const SchemaCompatible + const SchemaForwardCompat + const SchemaIncompatible + type SchemaDefinition struct + AllowUnknown bool + CompatibleWith string + ContentType string + Deprecated bool + Description string + Name string + Required []string + Version string + type SchemaRegistry interface + Register func(SchemaDefinition) error + Validate func(context.Context, Message) error + type SecurityConfig struct + InsecureDev bool + RequireClientCert bool + RequireTLS bool + type SegmentCompactor struct + func (c *SegmentCompactor) Compact(ctx context.Context) error + func (c *SegmentCompactor) Start() + func (c *SegmentCompactor) Stop() + type SegmentMeta struct + CleanClose bool + ClosedAt time.Time + CreatedAt time.Time + Filename string + FirstSeq uint64 + ID uint64 + IndexFile string + LastSeq uint64 + Records uint64 + SizeBytes int64 + type SegmentedWALConfig struct + Codec FrameCodec + CompactionInterval time.Duration + Dir string + DisableCompactor bool + MaxSegmentSize int64 + MaxSegments int + Retention time.Duration + WALCodec *WALRecordCodec + func (cfg SegmentedWALConfig) LegacyCodec() FrameCodec + type SegmentedWALManifest struct + ActiveSegment uint64 + CheckpointFile string + LastCompactionAt time.Time + NextSeq uint64 + Segments []SegmentMeta + Version int + type SegmentedWALStore struct + func NewSegmentedWALStore(cfg SegmentedWALConfig) (*SegmentedWALStore, error) + func (*SegmentedWALStore) ConfirmationLevel() ConfirmLevel + func (s *SegmentedWALStore) Ack(ctx context.Context, req AckRequest) error + func (s *SegmentedWALStore) AckBatch(ctx context.Context, reqs []AckRequest) []error + func (s *SegmentedWALStore) Append(ctx context.Context, msg Message, dests []Destination) ([]Message, error) + func (s *SegmentedWALStore) AppendAtomic(ctx context.Context, entries []AppendEntry) ([]Message, error) + func (s *SegmentedWALStore) AppendAtomicMinimal(ctx context.Context, entries []AppendEntry) error + func (s *SegmentedWALStore) AppendAtomicOwned(ctx context.Context, entries []AppendEntry) error + func (s *SegmentedWALStore) Close() error + func (s *SegmentedWALStore) CommitOffset(ctx context.Context, commit OffsetCommit) error + func (s *SegmentedWALStore) CommitStreamTransaction(ctx context.Context, tx StreamTransaction) ([]Message, error) + func (s *SegmentedWALStore) DeclareQueue(ctx context.Context, cfg QueueConfig) error + func (s *SegmentedWALStore) DeclareStream(ctx context.Context, cfg StreamConfig) error + func (s *SegmentedWALStore) DeclareTopic(ctx context.Context, cfg TopicConfig) error + func (s *SegmentedWALStore) ExtendLease(ctx context.Context, req LeaseRequest) error + func (s *SegmentedWALStore) Lease(ctx context.Context, req LeaseRequest) ([]Message, error) + func (s *SegmentedWALStore) Move(ctx context.Context, req MoveRequest) (MoveResult, error) + func (s *SegmentedWALStore) Nack(ctx context.Context, req NackRequest) error + func (s *SegmentedWALStore) PauseQueue(ctx context.Context, name string) error + func (s *SegmentedWALStore) PurgeQueue(ctx context.Context, name string) (int, error) + func (s *SegmentedWALStore) ResumeQueue(ctx context.Context, name string) error + func (s *SegmentedWALStore) SetHealthCallback(fn func(error)) + func (s *SegmentedWALStore) StoreHealth() error + func (s *SegmentedWALStore) Update(ctx context.Context, msg Message) error + func (s *SegmentedWALStore) UpdateBatch(ctx context.Context, messages []Message) []error + type SegmentedWALVerificationReport struct + ActiveSegment uint64 + Dir string + ManifestVersion int + Problems []WALVerificationProblem + SegmentReports []WALVerificationReport + TotalBytes int64 + TotalRecords uint64 + TotalSegments int + VerifiedAt time.Time + func VerifySegmentedWAL(dir string, walCodec *WALRecordCodec, legacyCodec FrameCodec) (SegmentedWALVerificationReport, error) + func (r SegmentedWALVerificationReport) Valid() bool + type Severity string + const SeverityDebug + const SeverityError + const SeverityInfo + const SeverityWarn + type ShovelConfig struct + BatchSize int + Destination string + PollInterval time.Duration + Source string + type ShovelManager struct + func NewShovelManager(b *Broker) *ShovelManager + func (sm *ShovelManager) StartShovel(cfg ShovelConfig) string + func (sm *ShovelManager) Stop() + func (sm *ShovelManager) StopShovel(id string) + type SparseIndex struct + func LoadSparseIndex(path string, step int) (*SparseIndex, error) + func NewSparseIndex(step int) *SparseIndex + func (idx *SparseIndex) Add(seq uint64, offset int64, t int64) bool + func (idx *SparseIndex) Entries() []IndexEntry + func (idx *SparseIndex) FindOffset(seq uint64) int64 + func (idx *SparseIndex) ForceAdd(seq uint64, offset int64, t int64) + func (idx *SparseIndex) SaveToFile(path string) error + type StateStore interface + Close func() error + type StatsResponse struct + Goroutines int + LastGCDuration string + Memory runtime.MemStats + NumGC uint32 + PauseTotal string + StartedAt time.Time + State BrokerState + StoreStats StoreStats + Uptime string + type StorageConfig struct + Directory string + EncryptionKeyID string + MaxDiskBytes int64 + SegmentBytes int64 + Sync bool + type StorageEvent struct + Error error + Message Message + Operation string + Time time.Time + type Store interface + Ack func(context.Context, AckRequest) error + Append func(context.Context, Message, []Destination) ([]Message, error) + Close func() error + CommitOffset func(context.Context, OffsetCommit) error + ConsumerOffset func(context.Context, OffsetCommit) (uint64, error) + DeclareQueue func(context.Context, QueueConfig) error + DeclareStream func(context.Context, StreamConfig) error + DeclareTopic func(context.Context, TopicConfig) error + ExtendLease func(context.Context, LeaseRequest) error + Get func(context.Context, string) (Message, bool, error) + History func(context.Context, string) ([]MessageHistory, error) + Lease func(context.Context, LeaseRequest) ([]Message, error) + ListDLQ func(context.Context, string, int) ([]Message, error) + ListQueue func(context.Context, string, int) ([]Message, error) + ListTopic func(context.Context, string, int) ([]Message, error) + Move func(context.Context, MoveRequest) (MoveResult, error) + Nack func(context.Context, NackRequest) error + PauseQueue func(context.Context, string) error + PurgeQueue func(context.Context, string) (int, error) + ReadStream func(context.Context, StreamReadRequest) ([]Message, error) + ReadTopic func(context.Context, string, string, int) ([]Message, error) + ResumeQueue func(context.Context, string) error + Stats func(context.Context) (StoreStats, error) + SweepLeases func(context.Context, time.Time) (int, error) + Update func(context.Context, Message) error + type StoreCircuitBreaker struct + func NewStoreCircuitBreaker(store Store, cfg CircuitBreakerConfig) *StoreCircuitBreaker + func (scb *StoreCircuitBreaker) Ack(ctx context.Context, req AckRequest) error + func (scb *StoreCircuitBreaker) Append(ctx context.Context, msg Message, dests []Destination) ([]Message, error) + func (scb *StoreCircuitBreaker) Close() error + func (scb *StoreCircuitBreaker) CommitOffset(ctx context.Context, commit OffsetCommit) error + func (scb *StoreCircuitBreaker) ConsumerOffset(ctx context.Context, commit OffsetCommit) (uint64, error) + func (scb *StoreCircuitBreaker) DeclareQueue(ctx context.Context, cfg QueueConfig) error + func (scb *StoreCircuitBreaker) DeclareStream(ctx context.Context, cfg StreamConfig) error + func (scb *StoreCircuitBreaker) DeclareTopic(ctx context.Context, cfg TopicConfig) error + func (scb *StoreCircuitBreaker) ExtendLease(ctx context.Context, req LeaseRequest) error + func (scb *StoreCircuitBreaker) Get(ctx context.Context, id string) (Message, bool, error) + func (scb *StoreCircuitBreaker) History(ctx context.Context, id string) ([]MessageHistory, error) + func (scb *StoreCircuitBreaker) Lease(ctx context.Context, req LeaseRequest) ([]Message, error) + func (scb *StoreCircuitBreaker) ListDLQ(ctx context.Context, name string, limit int) ([]Message, error) + func (scb *StoreCircuitBreaker) ListQueue(ctx context.Context, name string, limit int) ([]Message, error) + func (scb *StoreCircuitBreaker) Move(ctx context.Context, req MoveRequest) (MoveResult, error) + func (scb *StoreCircuitBreaker) Nack(ctx context.Context, req NackRequest) error + func (scb *StoreCircuitBreaker) PauseQueue(ctx context.Context, name string) error + func (scb *StoreCircuitBreaker) PurgeQueue(ctx context.Context, name string) (int, error) + func (scb *StoreCircuitBreaker) ReadStream(ctx context.Context, req StreamReadRequest) ([]Message, error) + func (scb *StoreCircuitBreaker) ResumeQueue(ctx context.Context, name string) error + func (scb *StoreCircuitBreaker) State() CircuitState + func (scb *StoreCircuitBreaker) Stats(ctx context.Context) (StoreStats, error) + func (scb *StoreCircuitBreaker) SweepLeases(ctx context.Context, now time.Time) (int, error) + func (scb *StoreCircuitBreaker) Update(ctx context.Context, msg Message) error + type StoreHealthCallbackRegistrar interface + SetHealthCallback func(fn func(error)) + type StoreHealthMonitor struct + func NewStoreHealthMonitor(b *Broker, store Store, interval time.Duration) *StoreHealthMonitor + func (m *StoreHealthMonitor) CheckHealth(ctx context.Context) error + func (m *StoreHealthMonitor) Fence(err error) + func (m *StoreHealthMonitor) FenceError() error + func (m *StoreHealthMonitor) IsFenced() bool + func (m *StoreHealthMonitor) SetOnFenced(fn func(error)) + func (m *StoreHealthMonitor) Start(ctx context.Context) + func (m *StoreHealthMonitor) Stop() + type StoreHealthProvider interface + StoreHealth func() error + type StoreStats struct + DLQ map[string]int + DeadLetter int + Leased int + Messages int + Offsets map[string]map[string]uint64 + Queues map[string]int + Streams map[string]int + Topics map[string]int + type StrategyConfig struct + Capabilities []string + FallbackStrategy StrategyType + HashKey string + MaxStickyBindings int + Metadata map[string]string + PriorityThreshold int + Queue string + Rules []RoutingRule + StickyKey string + Topic string + Type StrategyType + Weight int + type StrategyRegistry struct + func NewStrategyRegistry() *StrategyRegistry + func (r *StrategyRegistry) Get(name StrategyType) (ConsumerStrategy, bool) + func (r *StrategyRegistry) List() []StrategyType + func (r *StrategyRegistry) Register(strategy ConsumerStrategy) + type StrategyType string + const StrategyAdaptiveLoadBalance + const StrategyCapabilityBased + const StrategyConsistentHash + const StrategyFanOut + const StrategyHealthBased + const StrategyLeastLoaded + const StrategyPowerOfTwoChoices + const StrategyPriorityAware + const StrategyRandom + const StrategyRoundRobin + const StrategyRuleBased + const StrategySharded + const StrategyStickySession + const StrategyWeightedRoundRobin + type StreamCompactionStats struct + Compacted int + Duplicates int + Stream string + TotalMsgs int + type StreamConfig struct + Compact bool + Name string + Partitions int + Retention time.Duration + type StreamConsumerLag struct + ConsumerLag map[string]uint64 + HeadOffset uint64 + Stream string + type StreamLogCompaction struct + func NewStreamLogCompaction(b *Broker) *StreamLogCompaction + func (slc *StreamLogCompaction) CompactByDedup(ctx context.Context, stream string, limit int) (int, error) + func (slc *StreamLogCompaction) StatsForStream(ctx context.Context, stream string) (*StreamCompactionStats, error) + type StreamReadRequest struct + AfterOffset uint64 + ConsumerGroup string + Limit int + Stream string + TenantID string + type StreamTransaction struct + Entries []AppendEntry + ExpectedOffset uint64 + Offset OffsetCommit + type StreamTransactionHTTPPayload struct + ConsumerGroup string + ExpectedOffset uint64 + Messages []PublishHTTPPayload + Offset uint64 + TenantID string + type StreamTransactionStore interface + CommitStreamTransaction func(context.Context, StreamTransaction) ([]Message, error) + type Subscription struct + func (s *Subscription) ID() string + func (s *Subscription) Pause() + func (s *Subscription) Resume() + func (s *Subscription) Stop() + type TTLSweepResult struct + DeadLettered int + Expired int + Inspected int + Purged int + type TTLSweeper struct + func NewTTLSweeper(b *Broker, cfg TTLSweeperConfig) *TTLSweeper + func (ts *TTLSweeper) Start(ctx context.Context) + func (ts *TTLSweeper) Stop() + func (ts *TTLSweeper) Sweep(ctx context.Context) (TTLSweepResult, error) + type TTLSweeperConfig struct + BatchSize int + ExpireToDLQ bool + Interval time.Duration + type TaskDelivery struct + Task TaskInfo + func (d TaskDelivery) Decode(out any) error + type TaskEvent struct + Error error + Task TaskInfo + Time time.Time + type TaskFuture interface + type TaskHandle interface + Cancel func(context.Context, string) error + ID func() string + Info func(context.Context) (TaskInfo, error) + Logs func(context.Context) ([]MessageHistory, error) + Progress func(context.Context) (Progress, error) + Replay func(context.Context) error + Result func(context.Context, any) error + Retry func(context.Context) error + Status func(context.Context) (TaskStatus, error) + Wait func(context.Context) (TaskResult, error) + type TaskHandler func(context.Context, TaskDelivery) (any, error) + type TaskInfo struct + Attempts int + CreatedAt time.Time + FinishedAt time.Time + ID string + LastError string + MessageID string + Metadata map[string]string + Name string + Progress Progress + Queue string + Result []byte + StartedAt time.Time + Status TaskStatus + TenantID string + UpdatedAt time.Time + type TaskOption func(*TaskOptions) + func WithTaskDelay(v time.Duration) TaskOption + func WithTaskID(v string) TaskOption + func WithTaskIdempotencyKey(v string) TaskOption + func WithTaskMaxAttempts(v int) TaskOption + func WithTaskMetadata(v map[string]string) TaskOption + func WithTaskPriority(v int) TaskOption + func WithTaskProgressTopic(v string) TaskOption + func WithTaskQueue(v string) TaskOption + func WithTaskResultTopic(v string) TaskOption + func WithTaskRetryPolicy(v RetryPolicy) TaskOption + func WithTaskRunAt(v time.Time) TaskOption + func WithTaskTenantID(v string) TaskOption + func WithTaskTimeout(v time.Duration) TaskOption + type TaskOptions struct + Delay time.Duration + ID string + IdempotencyKey string + MaxAttempts int + Metadata map[string]string + Priority int + ProgressTopic string + Queue string + ResultTopic string + RetryPolicy RetryPolicy + RunAt time.Time + TenantID string + Timeout time.Duration + type TaskResult struct + Error error + Payload []byte + Task TaskInfo + type TaskRouter struct + func NewTaskRouter(loader *RoutingConfigLoader) *TaskRouter + func (tr *TaskRouter) ListPlans() []string + func (tr *TaskRouter) RegisterPlan(plan RoutingPlan) + func (tr *TaskRouter) Reload() error + func (tr *TaskRouter) SelectConsumers(ctx context.Context, msg Message, candidates []ConsumerCandidate) ([]ConsumerCandidate, error) + func (tr *TaskRouter) UnregisterPlan(name string) + type TaskStateStore interface + DeleteTask func(context.Context, string) error + GetTask func(context.Context, string) (TaskInfo, bool, error) + ListTasks func(context.Context, TaskStatus, int) ([]TaskInfo, error) + PutTask func(context.Context, TaskInfo) error + type TaskStatus string + const TaskArchived + const TaskBlocked + const TaskCancelled + const TaskCompensated + const TaskCompensating + const TaskCreated + const TaskDeadLettered + const TaskExpired + const TaskFailed + const TaskLeased + const TaskProgressing + const TaskQueued + const TaskRetrying + const TaskRunning + const TaskScheduled + const TaskSucceeded + const TaskValidated + const TaskWaiting + type TenancyConfig struct + DefaultTenant string + Enabled bool + IsolationLevel IsolationLevel + MaxMessagesPerTenant int + MaxQueuesPerTenant int + QueuePrefix string + RateLimitPerTenant int + type TenantManager struct + func NewTenantManager(b *Broker, cfg TenancyConfig) *TenantManager + func (tm *TenantManager) CheckPublishQuota(ctx context.Context, tenant string, destinations []Destination) error + func (tm *TenantManager) CheckQuota(ctx context.Context, tenant string) error + func (tm *TenantManager) EnsureTenant(name string) *TenantState + func (tm *TenantManager) GetTenant(name string) *TenantState + func (tm *TenantManager) ListTenants() []*TenantState + func (tm *TenantManager) QueueName(tenant, queue string) string + func (tm *TenantManager) StatsForTenant(ctx context.Context, tenant string) (*TenantStats, error) + func (tm *TenantManager) Stop() + func (tm *TenantManager) TenantAwarePublish(ctx context.Context, tenant string, topic string, payload any, ...) (PublishResult, error) + func (tm *TenantManager) TenantAwareSubscribe(ctx context.Context, tenant string, cfg ConsumerConfig, handler Handler) (*Subscription, error) + func (tm *TenantManager) TopicName(tenant, topic string) string + type TenantQuotas struct + MaxMessages int + MaxQueues int + RateLimit int + type TenantState struct + CreatedAt time.Time + MessageCount int + Name string + QueueCount int + Quotas TenantQuotas + type TenantStats struct + DLQCount int + LeasedCount int + MessageCount int + QueueCount int + Tenant string + TopicCount int + type TopicConfig struct + Name string + Partitions int + Paused bool + Retention time.Duration + type TopicPartition struct + Partition int + Topic string + type TopicPartitionStats struct + Partitions []PartitionInfo + Topic string + TotalMsgs int + type TraceExporter interface + ExportSpan func(ctx context.Context, span TraceSpan) error + Flush func(ctx context.Context) error + type TraceSpan struct + Attributes map[string]string + Duration time.Duration + EndTime time.Time + Error string + Operation string + ParentID string + Service string + SpanID string + StartTime time.Time + Status TraceStatus + TraceID string + type TraceStatus string + const TraceError + const TraceOK + type Tracer struct + func NewTracer(cfg TracerConfig) *Tracer + func (t *Tracer) ClearSpans() + func (t *Tracer) EndSpan(span *TraceSpan, err error) + func (t *Tracer) Finish(span *TraceSpan) + func (t *Tracer) FinishWithErr(span *TraceSpan, err error) + func (t *Tracer) Spans() []TraceSpan + func (t *Tracer) Start() + func (t *Tracer) StartSpan(ctx context.Context, operation string, attrs map[string]string) (context.Context, *TraceSpan) + func (t *Tracer) Stop() + func (t *Tracer) TracingHooks() Hooks + type TracerConfig struct + Enabled bool + Exporter TraceExporter + MaxSpans int + SampleRate float64 + ServiceName string + type TransactionalOutbox = PublishRetryBuffer + func NewTransactionalOutbox(b *Broker) *TransactionalOutbox + type TxOption func(*TxOptions) + type TxOptions struct + type VersionedSchema struct + Definition SchemaDefinition + RegisteredAt time.Time + type WALCodecConfig struct + CompressThreshold int + EncryptionKey []byte + MaxRecordSize int + SigningKey []byte + type WALCodecConfigProvider interface + WALCodecConfig func() WALCodecConfig + type WALCompactionConfig struct + ArchiveDir string + CompactionInterval time.Duration + MaxAge time.Duration + MaxSegmentSize int64 + MaxSegments int + MinSegmentFiles int + RetainAcked bool + type WALCompactor struct + func NewWALCompactor(dir string, cfg WALCompactionConfig, store *MemoryStore) *WALCompactor + func (wc *WALCompactor) Compact() error + func (wc *WALCompactor) ListSegments() ([]walSegment, error) + func (wc *WALCompactor) Start() + func (wc *WALCompactor) Stats() WALSegmentStats + func (wc *WALCompactor) Stop() + type WALRecordCodec struct + func NewWALRecordCodec(cfg WALCodecConfig) (*WALRecordCodec, error) + type WALSegmentStats struct + ActiveSegmentPath string + ActiveSegmentSize int64 + ArchivedSegments int + ArchivedTotalSize int64 + TotalMessages int + type WALVerificationProblem struct + Error string + Offset int64 + Tail bool + type WALVerificationReport struct + GoodPrefixBytes int64 + LegacyRecords uint64 + NativeRecords uint64 + Path string + Problems []WALVerificationProblem + Records uint64 + SizeBytes int64 + VerifiedAt time.Time + func ExportBinaryWAL(path string, output io.Writer, walCodec *WALRecordCodec, ...) (WALVerificationReport, error) + func ImportBinaryWAL(input io.Reader, path string, walCodec *WALRecordCodec) (report WALVerificationReport, err error) + func RepairBinaryWALTail(path string, walCodec *WALRecordCodec, legacyCodec FrameCodec) (WALVerificationReport, string, error) + func VerifyBinaryWAL(path string, walCodec *WALRecordCodec, legacyCodec FrameCodec) (WALVerificationReport, error) + func (r WALVerificationReport) Valid() bool + type WebSocketConfig struct + ACL *ACL + HeartbeatInterval time.Duration + InsecureDev bool + MaxConnections int + Path string + type WebSocketServer struct + func NewWebSocketServer(b *Broker, cfg WebSocketConfig) *WebSocketServer + func (ws *WebSocketServer) Broadcast(msgType string, data any) + func (ws *WebSocketServer) ConnectionCount() int + func (ws *WebSocketServer) Handler() http.Handler + func (ws *WebSocketServer) SetToken(token string) + func (ws *WebSocketServer) Stop() + type WebhookAttempt struct + Attempt int + Error string + ID string + NotificationID string + Payload []byte + StatusCode int + Success bool + Timestamp time.Time + URL string + type WebhookCallback struct + Client *http.Client + MaxAttempts int + RetryDelay time.Duration + Timeout time.Duration + Token string + URL string + func (w WebhookCallback) HandleNotification(ctx context.Context, n Notification) error