20 public static function run()
26 $message = self::generateMessage();
27 self::sendMessage($message);
33 private static function generateMessage():
Message
37 'userId' => CCalendar::GetUserId(),
38 'content' =>
'Message sended ' . date(
'Y-m-d H:i:s'),
39 'exampleField' =>
'dwdwdw',
41 ->setRoutingKey(
'example')
54 private static function sendMessage(Message $message)
56 Queue\Producer\Factory::getProduser()->send($message);
64 private static function registerRule()
66 Registry::getInstance()->registerRuleClass(RuleExample::class);