DPIclimate / broker

3 stars 3 forks source link

Refactor delivery code to have a common base and use the DB to store jobs #36

Closed dajtxx closed 1 week ago

dajtxx commented 1 year ago

The deliverers would be easier to write and more robust if we make a couple of changes to them.

  1. Create a new base receiver class that receives the message from the logical_timeseries exchange and writes an entry to a deliverer-specific table containing the rabbitmq message id and the context uuid of the message and ack the rabbitmq message at this point. This base receiver class should create this table based upon the receiver's name defined in the subclass.

  2. Have a second piece of async code that reads from that table and delivers the message. The message can be retrieved from the physical_timeseries table. This table should be renamed logical_timeseries and the broker context id added as an indexed column or an index added to the json_msg.cid member. The table row can be removed after the message is delivered successfully. This second piece of code is destination-specific and the async loop should call the python equivalent of an overridden method.

This should help with #15 .

dajtxx commented 1 week ago

Tracking progress in issue #93.