factory

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 109 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConnectionString

func BuildConnectionString(cfg map[string]string, sourceType string) string

func CreateSink

func CreateSink(cfg SinkConfig) (hermod.Sink, error)

func CreateSinkForPreview added in v1.8.1

func CreateSinkForPreview(cfg SinkConfig) (hermod.Sink, error)

CreateSinkForPreview builds a sink without the tracing and retry decorators, for a caller that renders a sink's templates rather than writes through it. The decorators wrap the sink in a type the caller cannot look inside, and a preview never sends, so neither of them is wanted.

func CreateSinkForTransactionGroup

func CreateSinkForTransactionGroup(cfg SinkConfig) (hermod.Sink, error)

CreateSinkForTransactionGroup builds a sink for membership of a transactional group, without the tracing and retry decorators.

Two reasons, and either alone would be enough.

The decorators forward Write, WriteBatch and the discovery calls, but not Begin, Commit, Prepare or CommitPrepared. A decorated sink therefore does not satisfy hermod.TwoPhaseCommit, and a group refuses to start when a member does not — so every group built through the registry failed at startup, while the tests that construct sinks directly passed.

The second reason is why forwarding them through the decorators would be the wrong fix. Retrying a failed Write inside a prepared transaction is not a retry of an idempotent operation: the transaction may already be aborted, and a write that did land would be applied twice within the same prepared transaction. Failure handling for a group belongs to the coordinator, which rolls every participant back together. A member that quietly retried underneath it would be making that decision on its own.

func CreateSource

func CreateSource(cfg SourceConfig) (hermod.Source, error)

func DLQRecoveryCapableSinkTypes added in v1.8.1

func DLQRecoveryCapableSinkTypes() []string

DLQRecoveryCapableSinkTypes returns the sink types usable as a dead-letter sink that the engine can also drain. The result is a copy: callers sort and filter it.

func SupportsDLQRecovery added in v1.8.1

func SupportsDLQRecovery(sinkType string) bool

SupportsDLQRecovery reports whether a dead-letter sink of this type can be read back for PrioritizeDLQ or an on-demand drain.

func SupportsTwoPhaseCommit

func SupportsTwoPhaseCommit(sinkType string) bool

SupportsTwoPhaseCommit reports whether a sink of this type can be a member of a transactional group.

func TwoPhaseCapableSinkTypes

func TwoPhaseCapableSinkTypes() []string

TwoPhaseCapableSinkTypes returns the sink types that can join a transactional group. The result is a copy: callers sort and filter it.

Types

type SinkConfig

type SinkConfig struct {
	ID     string           `json:"id"`
	Type   string           `json:"type"`
	Config hermod.StringMap `json:"config"`
}

type SourceConfig

type SourceConfig struct {
	ID                 string           `json:"id"`
	Type               string           `json:"type"`
	Config             hermod.StringMap `json:"config"`
	State              hermod.StringMap `json:"state"`
	ReconnectIntervals []time.Duration  `json:"-"`
}

Jump to

Keyboard shortcuts

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