messageprocessor

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

README

messageprocessor - An abstraction for consuming aws Kinesis messages

GoDoc Build Status codecov.io

Contributing

License

This project is licensed under Apache 2.0. See LICENSE.txt for details.

Contributing Agreement

Atlassian requires signing a contributor's agreement before we can accept a patch. If you are an individual you can fill out the individual CLA. If you are contributing on behalf of your company then please fill out the corporate CLA.

Documentation

Overview

Package messageprocessor is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain []Decorator

Chain is an ordered collection of Decorators.

func (Chain) Apply

func (c Chain) Apply(base MessageProcessor) MessageProcessor

Apply wraps the given RoundTripper with the Decorator chain.

type Decorator

type Decorator func(MessageProcessor) MessageProcessor

Decorator is a named type for any function that takes a RoundTripper and returns a RoundTripper.

type MaxRetriesExceededError added in v0.1.0

type MaxRetriesExceededError struct {
	Retryable bool
	OrigErr   error
	Wait      int
}

MaxRetriesExceededError implements MessageProcessorError and is used to indicate to upstream application/ decorators that retries have been attempted and exhausted

func (MaxRetriesExceededError) Error added in v0.1.0

func (t MaxRetriesExceededError) Error() string

func (MaxRetriesExceededError) IsRetryable added in v0.1.0

func (t MaxRetriesExceededError) IsRetryable() bool

IsRetryable indicates whether or not the JiraClient Error that was returned should be retried

func (MaxRetriesExceededError) RetryAfter added in v0.1.0

func (t MaxRetriesExceededError) RetryAfter() int

RetryAfter is not relevant in context of MaxRetriesExceededError as IsRetryable is set to false

type MessageProcessor

type MessageProcessor interface {
	ProcessMessage(ctx context.Context, record *kinesis.Record) MessageProcessorError
}

MessageProcessor processes a consumed message. Implementors are responsible for unmarshalling the data

type MessageProcessorError added in v0.2.0

type MessageProcessorError interface {
	IsRetryable() bool
	Error() string
	RetryAfter() int
}

MessageProcessorError represents an error that can be used to indicate to the consumer that an error should be retried

type MockMessageProcessor added in v0.1.0

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

MockMessageProcessor is a mock of MessageProcessor interface.

func NewMockMessageProcessor added in v0.1.0

func NewMockMessageProcessor(ctrl *gomock.Controller) *MockMessageProcessor

NewMockMessageProcessor creates a new mock instance.

func (*MockMessageProcessor) EXPECT added in v0.1.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMessageProcessor) ProcessMessage added in v0.1.0

func (m *MockMessageProcessor) ProcessMessage(ctx context.Context, record *kinesis.Record) MessageProcessorError

ProcessMessage mocks base method.

type MockMessageProcessorError added in v0.2.0

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

MockMessageProcessorError is a mock of MessageProcessorError interface.

func NewMockMessageProcessorError added in v0.2.0

func NewMockMessageProcessorError(ctrl *gomock.Controller) *MockMessageProcessorError

NewMockMessageProcessorError creates a new mock instance.

func (*MockMessageProcessorError) EXPECT added in v0.2.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMessageProcessorError) Error added in v0.2.0

func (m *MockMessageProcessorError) Error() string

Error mocks base method.

func (*MockMessageProcessorError) IsRetryable added in v0.2.0

func (m *MockMessageProcessorError) IsRetryable() bool

IsRetryable mocks base method.

func (*MockMessageProcessorError) RetryAfter added in v0.2.0

func (m *MockMessageProcessorError) RetryAfter() int

RetryAfter mocks base method.

type MockMessageProcessorErrorMockRecorder added in v0.2.0

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

MockMessageProcessorErrorMockRecorder is the mock recorder for MockMessageProcessorError.

func (*MockMessageProcessorErrorMockRecorder) Error added in v0.2.0

Error indicates an expected call of Error.

func (*MockMessageProcessorErrorMockRecorder) IsRetryable added in v0.2.0

IsRetryable indicates an expected call of IsRetryable.

func (*MockMessageProcessorErrorMockRecorder) RetryAfter added in v0.2.0

RetryAfter indicates an expected call of RetryAfter.

type MockMessageProcessorMockRecorder added in v0.1.0

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

MockMessageProcessorMockRecorder is the mock recorder for MockMessageProcessor.

func (*MockMessageProcessorMockRecorder) ProcessMessage added in v0.1.0

func (mr *MockMessageProcessorMockRecorder) ProcessMessage(ctx, record interface{}) *gomock.Call

ProcessMessage indicates an expected call of ProcessMessage.

type RetryableMessageProcessor added in v0.1.0

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

RetryableMessageProcessor is a `MessageProcessor` decorator that re-attempts processing of messages 'maxAttempts' number of times in case of failures 'maxAttempts' is a configurable parameter which can be set by consumer of this lib Exponential backoff has been implemented as a retry mechanism

func (*RetryableMessageProcessor) ProcessMessage added in v0.1.0

ProcessMessage invokes the wrapped `MessageProcessor`. Attempts retries using exponential backoff if underlying 'MessageProcessor' returns an error. If 'maxAttempts' are exceeded without successful processing, it emits a stat indicating the same

type RetryableMessageProcessorComponent added in v0.3.0

type RetryableMessageProcessorComponent struct{}

RetryableMessageProcessorComponent implements the settings.Component interface.

func NewComponent added in v0.3.0

func NewComponent() *RetryableMessageProcessorComponent

NewComponent populates default values.

func (*RetryableMessageProcessorComponent) New added in v0.3.0

func (*RetryableMessageProcessorComponent) Settings added in v0.3.0

Settings generates a config populated with defaults.

type RetryableMessageProcessorConfig added in v0.3.0

type RetryableMessageProcessorConfig struct {
	MaxAttempts int `description:"Maximum number of attempts to process kinesis message"`
}

RetryableMessageProcessorConfig is the config for creating a RetryableMessageProcessor

func (*RetryableMessageProcessorConfig) Name added in v0.3.0

Name of the config root.

Jump to

Keyboard shortcuts

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