@defer.inlineCallbacks
    def test_requeue_all_restart_then_reconsume(self):
        yield self.connect()
        
        yield self.amqp.chan.exchange_declare(exchange='messaging', type='topic')

        # Setup Consumer
        yield self.amqp.named_queue_declare(queue="submit.sm_all_2")
        yield self.amqp.chan.queue_bind(queue="submit.sm_all_2", exchange="messaging", routing_key="submit.sm.*")
        yield self.amqp.chan.basic_consume(queue="submit.sm_all_2", no_ack=False, consumer_tag='qtag')
        queue = yield self.amqp.client.queue('qtag')
        # Start consuming through _callback_reject_and_requeue_all
        queue.get().addCallback(self._callback_reject_and_requeue_all, queue).addErrback(self._errback)

        # Publish
        for i in range(50):
            yield self.amqp.publish(exchange='messaging', routing_key="submit.sm.connector01", 
                content=Content(str(i)))
        
        # Wait for 2 seconds
        # (give some time to the consumer to get its work done)
        yield waitFor(2)
        
        # Stop consuming and assert
        yield self.amqp.chan.basic_cancel(consumer_tag='qtag')
        self.assertGreaterEqual(self.rejectedMessages, 50)
        self.assertEqual(self.consumedMessages, 0)

        # Wait for 2 seconds
        # (give some time to the consumer to get its work done)
        yield waitFor(2)

        # Start consuming again
        yield self.amqp.chan.basic_consume(queue="submit.sm_all_2", no_ack=False, consumer_tag='qtag')
        queue = yield self.amqp.client.queue('qtag')
        # Consuming through _callback
        queue.get().addCallback(self._callback, queue).addErrback(self._errback)
        
        # Wait for 2 seconds
        # (give some time to the consumer to get its work done)
        yield waitFor(2)

        # Stop consuming and assert
        yield queue.close()
        self.assertEqual(self.consumedMessages, 50)

        yield self.amqp.disconnect()
Load the image data associated with a given longitude
dataset/ETHPy150Open jookies/jasmin/jasmin/queues/test/test_amqp.py/RejectAndRequeueTestCase.test_requeue_all_restart_then_reconsume--crossover with--dataset/ETHPy150Open ChrisBeaumont/brut/bubbly/viewer.py/BubblyViewer.load_longitude