protected function processPublish(Session $session, PublishMessage $msg)
    {
        if ($msg->getPublicationId() === null) {
            $msg->setPublicationId(Utils::getUniqueId());
        }

        /** @var SubscriptionGroup $subscriptionGroup */
        foreach ($this->subscriptionGroups as $subscriptionGroup) {
            $subscriptionGroup->processPublish($session, $msg);
        }

        if ($msg->acknowledge()) {
            $session->sendMessage(new PublishedMessage($msg->getRequestId(), $msg->getPublicationId()));
        }
    }