Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HandleFunc ¶
HandleFunc is a func to handle the message received from a subscription
func (HandleFunc) Do ¶
func (h HandleFunc) Do(ctx context.Context, _ Handler, msg *servicebus.Message) Handler
Do wraps a service message and returns a handlers
type Handler ¶
type Handler interface {
Do(ctx context.Context, orig Handler, message *servicebus.Message) Handler
}
Handler is the interface to handle messages
func Abandon ¶
func Abandon() Handler
Abandon stops processing the message and releases the lock on it.
func Complete ¶
func Complete() Handler
Complete will notify Azure Service Bus that the message was successfully handled and should be deleted from the queue
func Error ¶
Error is a wrapper around Abandon() that allows to trace the error before abandoning the message
func RetryLater ¶
RetryLater waits for the given duration before abandoning the lock. Consider examining/increasing your LockDuration/MaxDeliveryCount before using. Undefined behavior if RetryLater is passed a duration that puts the message handling past the lock duration (which has a max of 5 minutes)
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is the wrapping type of service bus message with a type
func New ¶
func New(msg *servicebus.Message) (*Message, error)
New creates a message, validating type first
func (*Message) Abandon ¶
Abandon will notify Azure Service Bus the message failed but should be re-queued for delivery.
func (*Message) Complete ¶
Complete will notify Azure Service Bus that the message was successfully handled and should be deleted from the queue
func (*Message) Data ¶
Data returns the message data as a string. Can be unmarshalled to the original struct
func (*Message) Error ¶
Error is a wrapper around Abandon() that allows to trace the error before abandoning the message
func (*Message) Message ¶
func (m *Message) Message() *servicebus.Message
Message returns the message as received by the SDK
func (*Message) RetryLater ¶
RetryLater waits for the given duration before retrying the processing of the message. This happens in memory and does not impact servicebus message max retry limit