Page MenuHomeDevCentral

Implement /delivery/unregister_consumer API method
ClosedPublic

Authored by dereckson on May 30 2017, 22:31.
Tags
None
Referenced Files
F3754579: D992.id2536.diff
Mon, Nov 18, 08:20
Unknown Object (File)
Wed, Nov 13, 06:47
Unknown Object (File)
Tue, Nov 12, 00:03
Unknown Object (File)
Mon, Nov 11, 18:41
Unknown Object (File)
Mon, Nov 11, 18:12
Unknown Object (File)
Mon, Nov 11, 16:44
Unknown Object (File)
Mon, Nov 11, 16:10
Unknown Object (File)
Mon, Nov 11, 15:16
Subscribers
None

Details

Summary

This API method deletes a queue.

Ref T1210

Test Plan

Post a JSON payload to http://localhost:5000/delivery/unregister_consumer

{
	"key": "b94c656b-5ee6-4135-8b8b-a787ef5ab5a6"
}

The queue delivery-b94c656b-5ee6-4135-8b8b-a787ef5ab5a6 was well deleted.

Diff Detail

Repository
rND Delivery API for Notifications center
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson added inline comments.
app.py
147

If we wish to ask the server to take care of the empty logic instead of doing it ourselves:

def delete_broker_queue(queue_name, force_queue_deletion):
    …
    channel.queue_delete(queue=queue_name, is_empty=not force_queue_deletion)
    …
167

Perhaps not needed (excepted if there is a use case for a /count), as server handles deletion only if empty).

218

According the spec, we can ask the server to take care of this check. See https://www.rabbitmq.com/amqp-0-9-1-reference.html#queue.delete.if-empty

So that would mean:

delete_broker_queue(queue, force_delete)
dereckson marked 3 inline comments as done.
dereckson edited edge metadata.

Trust broker to handle empty / not empty queue state.

This revision is now accepted and ready to land.Jul 5 2017, 23:04
This revision was automatically updated to reflect the committed changes.