Page MenuHomeDevCentral

Implement /delivery/unregister_consumer API method
ClosedPublic

Authored by dereckson on May 30 2017, 22:31.
Tags
None
Referenced Files
F2829369: D992.diff
Fri, Apr 19, 08:10
Unknown Object (File)
Thu, Apr 18, 18:08
Unknown Object (File)
Thu, Apr 18, 08:19
Unknown Object (File)
Sun, Apr 14, 20:39
Unknown Object (File)
Tue, Apr 9, 19:46
Unknown Object (File)
Tue, Apr 9, 13:26
Unknown Object (File)
Tue, Apr 9, 13:26
Unknown Object (File)
Thu, Apr 4, 09:19
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.