protected function getMessages($queue, $userId)
    {
        $messages = $queue->receive($userId);

        if (empty($messages)) {
            return [];
        }

        $messages = array_slice($messages, 0, 20);
        /** @var Module $module */
        $module = Yii::$app->getModule($this->module);
        $soundUrl = $module->soundUrl !== null ? Url::to($module->soundUrl) : null;

        $results = [];
        foreach ($messages as $message) {
            $result = [
                'title' => $queue->label,
                'body' => $message->body,
            ];
            if ($soundUrl !== null) {
                $result['sound'] = $soundUrl;
            }
            $results[] = $result;
        }

        return $results;
    }