/*
processRedeliveryQueue processes messages from the 'redelivery' queue.
The 'redelivery' queue is configured as the 'dead-letter-queue' for all queues in Orb. When a message is rejected by a
subscriber, it is automatically sent to the 'redelivery' queue. The first time a message is rejected, the redelivery
handler immediately redelivers the message to the original destination queue. If the message is rejected again, it is
posted to a 'wait' queue and is given an expiration. The 'wait' queue has no subscribers, so the message will sit there
until it expires. The 'redelivery' queue is also configured as the 'dead-letter-queue' for the 'wait' queue, so when the
message expires, it is automatically sent back to the 'redelivery' queue and this handler processes the message again.
If the message metadata, 'reason', is set to "expired" then it is posted to the original destination queue, otherwise
(if reason is "rejected") it is posted back to the 'wait' queue with a bigger expiration. This process repeats until the
maximum number of redelivery attempts has been reached, at which point redelivery for the message is aborted.
*/
processRedeliveryQueue processes messages from the 'redelivery' queue.
The 'redelivery' queue is configured as the 'dead-letter-queue' for all queues in Orb. When a message is rejected by a
subscriber, it is automatically sent to the 'redelivery' queue. The first time a message is rejected, the redelivery
handler immediately redelivers the message to the original destination queue. If the message is rejected again, it is
posted to a 'wait' queue and is given an expiration. The 'wait' queue has no subscribers, so the message will sit there
until it expires. The 'redelivery' queue is also configured as the 'dead-letter-queue' for the 'wait' queue, so when the
message expires, it is automatically sent back to the 'redelivery' queue and this handler processes the message again.
If the message metadata, 'reason', is set to "expired" then it is posted to the original destination queue, otherwise
(if reason is "rejected") it is posted back to the 'wait' queue with a bigger expiration. This process repeats until the
maximum number of redelivery attempts has been reached, at which point redelivery for the message is aborted.
/ * processRedeliveryQueue processes messages from the ' redelivery ' queue . The ' redelivery ' queue is configured as the ' dead - letter - queue ' for all queues in Orb . When a message is rejected by a subscriber it is automatically sent to the ' redelivery ' queue . The first time a message is rejected the redelivery handler immediately redelivers the message to the original destination queue . If the message is rejected again it is posted to a ' wait ' queue and is given an expiration . The ' wait ' queue has no subscribers so the message will sit there until it expires . The ' redelivery ' queue is also configured as the ' dead - letter - queue ' for the ' wait ' queue so when the message expires it is automatically sent back to the ' redelivery ' queue and this handler processes the message again . If the message metadata ' reason ' is set to " expired " then it is posted to the original destination queue otherwise ( if reason is " rejected " ) it is posted back to the ' wait ' queue with a bigger expiration . This process repeats until the maximum number of redelivery attempts has been reached at which point redelivery for the message is aborted . * /
func (p *PubSub) processRedeliveryQueue() {
	logger.Infof("Starting message redelivery listener")
	for msg := range p.redeliveryChan {
		p.handleRedelivery(msg)
	}
	logger.Infof("Message redelivery listener stopped")
}
func ( p * PubSub ) processRedeliveryQueue ( ) { logger . Infof ( " " ) for msg := range p . redeliveryChan { p . handleRedelivery ( msg ) } logger . Infof ( " " ) }
processRedeliveryQueue processes messages from the 'redelivery' queue.
processRedeliveryQueue processes messages from the ' redelivery ' queue .