aws

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend added in v0.8.0

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

func NewBackend added in v0.4.0

func NewBackend(settings Settings, logger hedwig.Logger) *Backend

NewBackend creates a Backend for publishing and consuming from AWS The provider metadata produced by this Backend will have concrete type: aws.Metadata

func (*Backend) AckMessage added in v0.8.0

func (b *Backend) AckMessage(ctx context.Context, providerMetadata interface{}) error

AckMessage acknowledges a message on the queue

func (*Backend) NackMessage added in v0.8.0

func (b *Backend) NackMessage(ctx context.Context, providerMetadata interface{}) error

NackMessage nacks a message on the queue

func (*Backend) Publish added in v0.8.0

func (b *Backend) Publish(ctx context.Context, message *hedwig.Message, payload []byte, attributes map[string]string, topic string) (string, error)

Publish a message represented by the payload, with specified attributes to the specific topic

func (*Backend) Receive added in v0.8.0

func (b *Backend) Receive(ctx context.Context, numMessages uint32, visibilityTimeout time.Duration, messageCh chan<- hedwig.ReceivedMessage) error

Receive messages from configured queue(s) and provide it through the callback. This should run indefinitely until the context is canceled. Provider metadata should include all info necessary to ack/nack a message.

func (*Backend) RequeueDLQ added in v0.8.0

func (b *Backend) RequeueDLQ(ctx context.Context, numMessages uint32, visibilityTimeout time.Duration, _ uint32) error

RequeueDLQ re-queues everything in the Hedwig DLQ back into the Hedwig queue

type Metadata added in v0.4.0

type Metadata struct {
	// AWS receipt identifier
	ReceiptHandle string

	// FirstReceiveTime is time the message was first received from the queue. The value
	//    is calculated as best effort and is approximate.
	FirstReceiveTime time.Time

	// SentTime when this message was originally sent to AWS
	SentTime time.Time

	// ReceiveCount received from SQS.
	//    The first delivery of a given message will have this value as 1. The value
	//    is calculated as best effort and is approximate.
	ReceiveCount int
}

Metadata is additional metadata associated with a message

type Settings added in v0.8.0

type Settings struct {
	// AWS Region
	AWSRegion string
	// AWS account id
	AWSAccountID string
	// AWS access key
	AWSAccessKey string
	// AWS secret key
	AWSSecretKey string
	// AWS session token that represents temporary credentials (i.e. for Lambda app)
	AWSSessionToken string
	// AWS read timeout for Publisher
	AWSReadTimeoutS time.Duration // optional; default: 2 seconds
	// Name of the queue for this application
	QueueName string
}

Settings for AWS Backend

Jump to

Keyboard shortcuts

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