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 MQ
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 Listener ¶
type Listener struct { MqOutput chan<- transmit.Serializable // data.RemoteFragmentDesc ToAcknowledge chan amqp.Delivery 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(channel chan<- transmit.Serializable, brokerURL, inputQueue string) (listener Listener, err error)
NewListener creates a new message queue listener
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
DeclareQueue defines an amqp Queue
func (Sender) StartBlocking ¶
func (sender Sender) StartBlocking()
StartBlocking listens to the channel, and send remoteFragments to the message queue on the OUTPUT_QUEUE queue.