/** * @param mixed $message * @param int $flags * @param array $attributes * * @return bool */ public function publish($message, $flags = Client::NOPARAM, array $attributes = []) { $attributes = ArrayHelper::merge(['app_id' => \Yii::$app ? \Yii::$app->name : ''], $attributes); return $this->exchange->publish($message, $this->routingKey, $flags, $attributes); }
/** * @param Exchange|string $exchange * * @return string */ public static function getExchangeName($exchange) { return !$exchange instanceof Exchange ? $exchange : $exchange->getName(); }