messaging

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxMessages = 10
View Source
const MessageHandlerMethodName = "Handle"

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecuteInvokedOperation added in v0.2.1

type ExecuteInvokedOperation struct {
	OperationId uuid.UUID `json:"operationId"`
}

this represents the message (command) that is sent to the operator to be executed

type MessageHandlerContext

type MessageHandlerContext struct {
	ReceivedMessage *azservicebus.ReceivedMessage
	// contains filtered or unexported fields
}

func (*MessageHandlerContext) Context

func (c *MessageHandlerContext) Context() context.Context

type MessageReceiver

type MessageReceiver interface {
	Start()
	Stop()
	GetName() string
}

func NewServiceBusReceiver

func NewServiceBusReceiver(handler any, credential azcore.TokenCredential, options ServiceBusMessageReceiverOptions) (MessageReceiver, error)

type MessageReceiverOptions

type MessageReceiverOptions struct {
	QueueName string
}

type MessageSender

type MessageSender interface {
	Send(ctx context.Context, queueName string, messages ...any) ([]SendMessageResult, error)
	EnsureTopology(ctx context.Context, queueName string) error
}

func NewServiceBusMessageSender

func NewServiceBusMessageSender(credential azcore.TokenCredential, options MessageSenderOptions) (MessageSender, error)

type MessageSenderOptions

type MessageSenderOptions struct {
	SubscriptionId          string
	Location                string
	ResourceGroupName       string
	FullyQualifiedNamespace string
}

type QueueName

type QueueName string
const (
	QueueNameEvents     QueueName = "events"
	QueueNameOperations QueueName = "operations"
)

type SendMessageResult

type SendMessageResult struct {
	Success bool
	Error   error
}

type ServiceBusMessageHandler

type ServiceBusMessageHandler interface {
	Handle(ctx context.Context, message *azservicebus.ReceivedMessage) error
}

func NewServiceMessageHandler

func NewServiceMessageHandler(handler any) (ServiceBusMessageHandler, error)

Creates a new service bus message handler from any handler struct by wrapping it required implementation of the handler: { Handle(message *T, context MessageHandlerContext) error }

type ServiceBusMessageReceiverOptions

type ServiceBusMessageReceiverOptions struct {
	MessageReceiverOptions
	FullyQualifiedNamespace string
	MaxMessages             int
}

Jump to

Keyboard shortcuts

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