public function publish($body, array $headers = [], $exchange = '', $routingKey = '', $mandatory = false, $immediate = false)
    {
        $response = $this->publishImpl($body, $headers, $exchange, $routingKey, $mandatory, $immediate);

        if ($this->mode === ChannelModeEnum::CONFIRM) {
            if ($response instanceof PromiseInterface) {
                return $response->then(function () {
                    return ++$this->deliveryTag;
                });
            } else {
                return ++$this->deliveryTag;
            }
        } else {
            return $response;
        }
    }