messaging

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmqpMessage

type AmqpMessage struct {
	// Todo: Should this be private?
	OriginalMessage *amqp.Message
}

AmqpMessage Wrapper for amqp

func (*AmqpMessage) Accept

func (m *AmqpMessage) Accept() error

Accept mark the message as processed successfully (don't re-queue)

func (*AmqpMessage) Body

func (m *AmqpMessage) Body() []byte

Body get the body

func (*AmqpMessage) DeliveryCount

func (m *AmqpMessage) DeliveryCount() int

DeliveryCount get number of times the message has ben delivered

func (*AmqpMessage) EventData

func (m *AmqpMessage) EventData() (common.Event, error)

EventData deserialize json value to type

func (*AmqpMessage) ID

func (m *AmqpMessage) ID() string

ID get the ID

func (*AmqpMessage) Reject

func (m *AmqpMessage) Reject() error

Reject mark message to be requeued

type Message

type Message interface {
	ID() string
	DeliveryCount() int
	Body() []byte
	Accept() error
	Reject() error
	EventData() (common.Event, error)
}

Message interface for any message protocol to use

func NewAmqpMessageWrapper

func NewAmqpMessageWrapper(m *amqp.Message) Message

NewAmqpMessageWrapper get number of times the message has ben delivered

Jump to

Keyboard shortcuts

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