def setup(self): super(Requester, self).setup() print 'Sending hello' self.publish( topics.BUILDING_SEND(campus='campus1', building='building1', topic='test/topic/hello'), {COOKIE: self.uuid}, 'Hello, Building!')
def publish_heartbeat(self): now = datetime.utcnow().isoformat(' ') + 'Z' headers = { 'AgentID': self._agentid, headers_mod.DATE: now, COOKIE: self._agentid, } message = {'message': 'HELLO from {agent}!'.format(agent=self._agentid)} for receiver in self._receiving_platforms: self.publish_json(topics.BUILDING_SEND( campus='campus', building=receiver, topic=settings.HELLO_TOPIC), headers, message)