Page MenuHomeDevCentral

Implement /delivery/unregister_consumer API method
ClosedPublic

Authored by dereckson on May 30 2017, 22:31.
Tags
None
Referenced Files
F5018860: D992.id2550.diff
Mon, Mar 3, 22:39
Unknown Object (File)
Wed, Feb 26, 06:10
Unknown Object (File)
Sat, Feb 22, 05:32
Unknown Object (File)
Sat, Feb 22, 03:56
Unknown Object (File)
Fri, Feb 21, 09:02
Unknown Object (File)
Sun, Feb 16, 16:43
Unknown Object (File)
Sun, Feb 16, 16:21
Unknown Object (File)
Mon, Feb 10, 14:06
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.