deliverymq

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMessageHandler

func NewMessageHandler(
	logger *logging.Logger,
	logMQ LogPublisher,
	tenantStore DestinationGetter,
	publisher Publisher,
	eventTracer DeliveryTracer,
	retryScheduler RetryScheduler,
	retryBackoff backoff.Backoff,
	retryMaxLimit int,
	idempotence idempotence.Idempotence,
) consumer.MessageHandler

func NewRetryScheduler

func NewRetryScheduler(deliverymq *DeliveryMQ, redisConfig *redis.RedisConfig, deploymentID string, pollBackoff time.Duration, logger *logging.Logger, eventGetter RetryEventGetter, opts ...RetrySchedulerOption) (scheduler.Scheduler, error)

func WithQueue

func WithQueue(queueConfig *mqs.QueueConfig) func(opts *DeliveryMQOption)

Types

type AttemptError added in v0.13.0

type AttemptError struct {
	// contains filtered or unexported fields
}

func (*AttemptError) Error added in v0.13.0

func (e *AttemptError) Error() string

func (*AttemptError) Unwrap added in v0.13.0

func (e *AttemptError) Unwrap() error

type DeliveryInfra

type DeliveryInfra interface {
	DeclareInfrastructure(ctx context.Context) error
}

type DeliveryMQ

type DeliveryMQ struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...func(opts *DeliveryMQOption)) *DeliveryMQ

func (*DeliveryMQ) Init

func (q *DeliveryMQ) Init(ctx context.Context) (func(), error)

func (*DeliveryMQ) Publish

func (q *DeliveryMQ) Publish(ctx context.Context, task models.DeliveryTask) error

func (*DeliveryMQ) Subscribe

func (q *DeliveryMQ) Subscribe(ctx context.Context, opts ...mqs.SubscribeOption) (mqs.Subscription, error)

type DeliveryMQOption

type DeliveryMQOption struct {
	QueueConfig *mqs.QueueConfig
}

type DeliveryTracer

type DeliveryTracer interface {
	Deliver(ctx context.Context, task *models.DeliveryTask, destination *models.Destination) (context.Context, trace.Span)
}

type DestinationGetter

type DestinationGetter interface {
	RetrieveDestination(ctx context.Context, tenantID, destID string) (*models.Destination, error)
}

type LogPublisher

type LogPublisher interface {
	Publish(ctx context.Context, entry models.LogEntry) error
}

type PostDeliveryError

type PostDeliveryError struct {
	// contains filtered or unexported fields
}

func (*PostDeliveryError) Error

func (e *PostDeliveryError) Error() string

func (*PostDeliveryError) Unwrap

func (e *PostDeliveryError) Unwrap() error

type PreDeliveryError

type PreDeliveryError struct {
	// contains filtered or unexported fields
}

Error types to distinguish between different stages of delivery

func (*PreDeliveryError) Error

func (e *PreDeliveryError) Error() string

func (*PreDeliveryError) Unwrap

func (e *PreDeliveryError) Unwrap() error

type Publisher

type Publisher interface {
	PublishEvent(ctx context.Context, destination *models.Destination, event *models.Event) (*models.Attempt, error)
}

type RetryEventGetter added in v0.13.0

type RetryEventGetter interface {
	ListAttempt(ctx context.Context, request logstore.ListAttemptRequest) (logstore.ListAttemptResponse, error)
}

RetryEventGetter is the interface for fetching prior attempts from logstore. ListAttempt returns both the attempt and the associated event data.

type RetryScheduler

type RetryScheduler interface {
	Schedule(ctx context.Context, task string, delay time.Duration, opts ...scheduler.ScheduleOption) error
	Cancel(ctx context.Context, taskID string) error
}

type RetrySchedulerOption added in v0.13.0

type RetrySchedulerOption func(*retrySchedulerConfig)

RetrySchedulerOption is a functional option for configuring the retry scheduler.

func WithRetryVisibilityTimeout added in v0.13.0

func WithRetryVisibilityTimeout(vt uint) RetrySchedulerOption

WithRetryVisibilityTimeout sets the visibility timeout for the retry scheduler queue. This controls how long a message is hidden after being received before it becomes visible again (for retry if the executor returned an error).

type RetryTask added in v0.13.0

type RetryTask struct {
	EventID       string
	TenantID      string
	DestinationID string
	Telemetry     *models.DeliveryTelemetry
}

RetryTask contains the minimal info needed to retry a delivery. The full Event data will be fetched from logstore when the retry executes.

func RetryTaskFromDeliveryTask added in v0.13.0

func RetryTaskFromDeliveryTask(task models.DeliveryTask) RetryTask

func (*RetryTask) FromString added in v0.13.0

func (m *RetryTask) FromString(str string) error

func (*RetryTask) ToDeliveryTask added in v0.13.0

func (m *RetryTask) ToDeliveryTask(event models.Event, attemptNumber int) models.DeliveryTask

func (*RetryTask) ToString added in v0.13.0

func (m *RetryTask) ToString() (string, error)

Jump to

Keyboard shortcuts

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