Skip to content
Snippets Groups Projects
Commit cec90f41 authored by Ruud Overeem's avatar Ruud Overeem
Browse files

Task #8531: Event message requires a context field during construction. E.g. otdb.treestatusupdate.

parent c1a43df9
No related branches found
No related tags found
No related merge requests found
......@@ -241,9 +241,10 @@ class EventMessage(LofarMessage):
will be stored in a persistent queue for later delivery.
"""
def __init__(self, content=None):
def __init__(self, context, content=None):
super(EventMessage, self).__init__(content)
self.durable = True
self.subject = context
class MonitoringMessage(LofarMessage):
......
......@@ -137,7 +137,7 @@ if __name__ == "__main__":
else:
for (treeid, state, modtime, creation) in record_list:
content = { "treeID" : treeid, "state" : state, "time_of_change" : modtime }
msg = EventMessage(content)
msg = EventMessage("otdb.treestatus", content)
print treeid, state, modtime, creation
send_bus.send(msg)
open('time_save.txt', 'wb').write(creation)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment