def handle(self): with closing(self.odb.session()) as session: item = session.query(OutgoingSTOMP).filter_by(id=self.request.input.id).one() start_time = time() # Will connect and disconnect hence confirming the path to a broker. session = create_stomp_session(self.outgoing.stomp[item.name].config) session.disconnect() response_time = time() - start_time self.response.payload.info = 'Ping heartbeat submitted, took:`{0:03.4f} s`, check server logs for details.'.format(response_time)
def handle(self): with closing(self.odb.session()) as session: item = session.query(OutgoingSTOMP).filter_by( id=self.request.input.id).one() start_time = time() # Will connect and disconnect hence confirming the path to a broker. session = create_stomp_session(self.outgoing.stomp[item.name].config) session.disconnect() response_time = time() - start_time self.response.payload.info = 'Ping heartbeat submitted, took:`{0:03.4f} s`, check server logs for details.'.format( response_time)
def ping(self, config): session = create_stomp_session(config) session.disconnect()