messageq

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acknowledger added in v0.1.14

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

Acknowledger is responsible for sending acknowledgement messages to the MQBroker

func NewAcknowledger added in v0.1.14

func NewAcknowledger(consumed chan amqp.Delivery, toAcknowledge chan transmit.Serializable) Acknowledger

NewAcknowledger isntantiates a new Acknowledger struct

func (*Acknowledger) Start added in v0.1.14

func (ack *Acknowledger) Start(wg *sync.WaitGroup)

Start asychronously calls StartBlocking via Gorouting

func (*Acknowledger) StartBlocking added in v0.1.14

func (ack *Acknowledger) StartBlocking()

StartBlocking listens on the two channels for new messages that were consumed but not acknowledged and for messages to acknowledge

type Consumer added in v0.1.18

type Consumer struct {
	Output        chan<- transmit.Serializable // *desc.RemoteFragmentDesc
	ToAcknowledge chan amqp.Delivery
	Exit          chan bool

	QueueName string
	// contains filtered or unexported fields
}

Consumer consumes messages from the messagequeue without acknowledging them

func NewConsumer added in v0.1.18

func NewConsumer(out chan transmit.Serializable, mqChannel *amqp.Channel, inputQueue string) (consumer Consumer)

NewConsumer creates a message consumer for a listener

func (*Consumer) Start added in v0.1.18

func (consumer *Consumer) Start(wg *sync.WaitGroup)

Start asychronously calls StartBlocking via a Goroutine

func (*Consumer) StartBlocking added in v0.1.18

func (consumer *Consumer) StartBlocking()

StartBlocking listens on the rabbitMQ messagequeue and redirects messages on the INPUT_QUEUE to a channel

func (*Consumer) Stop added in v0.1.18

func (consumer *Consumer) Stop()

Stop finishes up the consumer

type Listener

type Listener struct {
	BrokerURL   string
	TargetQueue string
	CanExit     chan bool
	// contains filtered or unexported fields
}

Listener is the structure that listens to RabbitMQ and redirects messages to a channel

func NewListener

func NewListener(output, finishedFragments chan transmit.Serializable, brokerURL, inputQueue string) (listener Listener, err error)

NewListener creates a new message queue listener

func (*Listener) Start

func (listener *Listener) Start(wg *sync.WaitGroup)

Start asychronously calls StartBlocking via Gorouting

func (*Listener) StartBlocking

func (listener *Listener) StartBlocking()

StartBlocking listens on the rabbitMQ messagequeue and redirects messages on the INPUT_QUEUE to a channel

type MqFragmentDesc

type MqFragmentDesc struct {
	desc.RemoteFragmentDesc
}

MqFragmentDesc is a structure describing an iterum fragment to process coming from the MQ For now it is a copy of RemoteFragmentDesc but extensible for the future

func (*MqFragmentDesc) Deserialize

func (mqfd *MqFragmentDesc) Deserialize(data []byte) (err error)

Deserialize tries to decode a json encoded byte array into `mqfd`. Errors on failure

func (*MqFragmentDesc) Serialize

func (mqfd *MqFragmentDesc) Serialize() (data []byte, err error)

Serialize tries to transform `mqfd` into a json encoded bytearray. Errors on failure

type Sender

type Sender struct {
	ToLineate   chan<- transmit.Serializable // desc.RemoteFragmentDesc
	TargetQueue string
	BrokerURL   string
	// contains filtered or unexported fields
}

Sender is the structure that listens to a channel and redirects messages to rabbitMQ

func NewSender

func NewSender(toSend, toLineate chan transmit.Serializable, brokerURL, targetQueue string) (sender Sender, err error)

NewSender creates a new sender which receives messages from a channel and sends them on the message queue.

func (Sender) DeclareQueue added in v0.1.11

func (sender Sender) DeclareQueue(queueName string, ch *amqp.Channel) amqp.Queue

DeclareQueue defines an amqp Queue

func (Sender) Start

func (sender Sender) Start(wg *sync.WaitGroup)

Start asychronously calls StartBlocking via Gorouting

func (Sender) StartBlocking

func (sender Sender) StartBlocking()

StartBlocking listens to the channel, and send remoteFragments to the message queue on the OUTPUT_QUEUE queue.

func (Sender) Stop added in v0.1.10

func (sender Sender) Stop()

Stop finishes up and notifies the user of its progress

Jump to

Keyboard shortcuts

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