Page MenuHomeDevCentral

Implement /delivery/register_consumer API method
ClosedPublic

Authored by dereckson on May 25 2017, 22:09.
Tags
None
Referenced Files
F4082000: D991.id2532.diff
Sat, Feb 1, 01:33
Unknown Object (File)
Fri, Jan 31, 21:19
Unknown Object (File)
Fri, Jan 31, 17:30
Unknown Object (File)
Tue, Jan 28, 01:08
Unknown Object (File)
Wed, Jan 22, 10:43
Unknown Object (File)
Wed, Jan 22, 09:56
Unknown Object (File)
Wed, Jan 22, 06:17
Unknown Object (File)
Tue, Jan 21, 06:14
Subscribers
None

Details

Summary

Declare a queue, bind the queue to an exchange.

A first approach was to connect to the broker at server start,
a channel, then to interact with the channel when requests come.

This approach isn't optimal as:

  • channel can be closed by errors like a non existing exchange
  • we want to recover if the broker restarts
  • the pika loop and the Werkzeug loop could behave differently

So each request will open/close a connection to the broker.

Ref T1210

Test Plan

Fire an API request, get a key, check a queue exists matching this key.

Diff Detail

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

Event Timeline

Improved style per previous comments.

app.py
36

Should follow other sections headings.

81

At some stage we quit the configuration methods to enter in a broker helper methods section.

106

double whiteline

Don't test if the broken connection works on login

That allows the microservice to be started before the broker.

This revision is now accepted and ready to land.May 27 2017, 10:31
This revision was automatically updated to reflect the committed changes.