sqs

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package sqs provides consumer implementation with included tracing capabilities.

Deprecated: The SQS consumer package along with the async component is superseded by the standalone `github.com/beatlabs/component/sqs` package. Please refer to the documents and the examples for the usage.

This package is frozen and no new functionality will be added.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory deprecated

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

Factory for creating SQS consumers.

Deprecated: The SQS consumer package along with the async component is superseded by the standalone `github.com/beatlabs/component/sqs` package.

func NewFactory deprecated

func NewFactory(queue sqsiface.SQSAPI, queueName string, oo ...OptionFunc) (*Factory, error)

NewFactory creates a new consumer factory.

Deprecated: The SQS consumer package along with the async component is superseded by the standalone `github.com/beatlabs/component/sqs` package.

func (*Factory) Create

func (f *Factory) Create() (async.Consumer, error)

Create a new SQS consumer.

type OptionFunc

type OptionFunc func(*Factory) error

OptionFunc definition for configuring the consumer in a functional way.

func MaxMessages

func MaxMessages(maxMessages int64) OptionFunc

MaxMessages option for setting the max number of messages fetched. Allowed values are between 1 and 10. If this option is unused, it defaults to 3. If messages can be processed very quickly, maxing out this value is fine, otherwise having a high value is risky as it might trigger the visibility timeout. Having a value too small isn't recommended either, as it increases the number of SQS API requests, thus AWS costs.

func PollWaitSeconds

func PollWaitSeconds(pollWaitSeconds int64) OptionFunc

PollWaitSeconds sets the wait time for the long polling mechanism in seconds. Allowed values are between 0 and 20. 0 enables short polling. If this option is unused, it defaults to the queue's default poll settings.

func QueueStatsInterval

func QueueStatsInterval(interval time.Duration) OptionFunc

QueueStatsInterval sets the interval at which we retrieve queue stats. If this option is unused, it defaults to 20 seconds.

func VisibilityTimeout

func VisibilityTimeout(visibilityTimeout int64) OptionFunc

VisibilityTimeout sets the time a message is invisible after it has been requested. This is a built in resiliency mechanism so that, should the consumer fail to acknowledge the message within such timeout, it will become visible again and thus available for retries. Allowed values are between 0 and and 12 hours in seconds. If this option is unused, it defaults to the queue's default visibility settings.

Jump to

Keyboard shortcuts

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