26 LOG = logging.getLogger(__name__)
29 @click.command(name=
'monitor')
32 def print_message(record):
34 LOG.info(
'New message in topic:\n%s',
35 pprint.pformat(json.loads(record.value)))
36 except Exception
as ex:
43 @click.command(name=
'fake-bolt')
45 @click.option(
'--count', default=3)
46 @click.option(
'--sleep', default=1)
51 res_dir = os.path.dirname(kilda.probe.test.res.__file__)
53 def print_message(record):
55 data = json.loads(record.value)
56 if data[
'clazz'] ==
'org.openkilda.messaging.ctrl.CtrlRequest':
57 LOG.info(
'New message in topic:\n%s', pprint.pformat(data))
58 for filename
in glob.glob(os.path.join(res_dir,
60 with open(filename)
as f:
61 message = json.load(f)
62 message[
'correlation_id'] = data[
'correlation_id']
67 LOG.exception(
'error')
def receive_with_context(context, callback, offset=None)
def bolt_command(ctx, count, sleep)
def send_with_context(context, message)