Repository: pika/pika

Issue:
Remove deprecated args from pika/connection.py for the 1.0.0 release target
A number of args in the file pika/connection.py are tagged as deprecated. Need to remove support and documentation for those deprecated args. perform a case-insensitive search for the word deprecated.

Discussion:

Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 7355839..8890012 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,7 +1,7 @@
 Version History
 ===============
 
-1.0.0b2 2019-01-22
+1.0.0b2 2019-02-04
 ------------------
 
 `GitHub milestone <https://github.com/pika/pika/milestone/8>`_
@@ -10,10 +10,10 @@ Version History
 - ``BlockingConnection.consume`` now returns ``(None, None, None)`` when inactivity timeout is reached (`PR <https://github.com/pika/pika/pull/899>`_)
 - Python 3.7 support (`Issue <https://github.com/pika/pika/issues/1107>`_)
 - ``all_channels`` parameter of the ``Channel.basic_qos`` method renamed to ``global_qos``
-
-
-**IMPORTANT**: The signature of the following methods has changed from Pika 0.13.0. In general, the callback parameter that indicates completion of the method has been moved to the end of the parameter list to be consistent with other parts of Pika's API and with other libraries in general.
-
+- **NOTE:** ``heartbeat_interval`` is removed, use ``heartbeat`` instead.
+- **NOTE:** The `backpressure_detection` option of `ConnectionParameters` and `URLParameters` property is REMOVED in favor of `Connection.Blocked` and `Connection.Unblocked`. See `Connection.add_on_connection_blocked_callback`.
+- **NOTE:** The legacy ``basic_publish`` method is removed, and ``publish`` renamed to ``basic_publish``
+- **NOTE**: The signature of the following methods has changed from Pika 0.13.0. In general, the callback parameter that indicates completion of the method has been moved to the end of the parameter list to be consistent with other parts of Pika's API and with other libraries in general.
 - ``basic_cancel``
 - ``basic_consume``
 - ``basic_get``
diff --git a/docs/examples/asynchronous_publisher_example.rst b/docs/examples/asynchronous_publisher_example.rst
index b07e831..4ad33aa 100644
--- a/docs/examples/asynchronous_publisher_example.rst
+++ b/docs/examples/asynchronous_publisher_example.rst
@@ -360,7 +360,7 @@ publisher.py::
         logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
 
         # Connect to localhost:5672 as guest with the password guest and virtual host "/" (%2F)
-        example = ExamplePublisher('amqp://guest:guest@localhost:5672/%2F?connection_attempts=3&heartbeat_interval=3600')
+        example = ExamplePublisher('amqp://guest:guest@localhost:5672/%2F?connection_attempts=3&heartbeat=3600')
         example.run()
 
 
diff --git a/docs/examples/heartbeat_and_blocked_timeouts.rst b/docs/examples/heartbeat_and_blocked_timeouts.rst
index 4548b7f..70d22c3 100644
--- a/docs/examples/heartbeat_and_blocked_timeouts.rst
+++ b/docs/examples/heartbeat_and_blocked_timeouts.rst
@@ -16,7 +16,7 @@ Example of configuring heartbeat and blocked-connection timeouts::
     def main():
 
         # NOTE: These parameters work with all Pika connection types
-        params = pika.ConnectionParameters(heartbeat_interval=600,
+        params = pika.ConnectionParameters(heartbeat=600,
                                            blocked_connection_timeout=300)
 
         conn = pika.BlockingConnection(params)
diff --git a/docs/examples/tls_mutual_authentication.rst b/docs/examples/tls_mutual_authentication.rst
index 8a68e19..2a89aa1 100644
--- a/docs/examples/tls_mutual_authentication.rst
+++ b/docs/examples/tls_mutual_authentication.rst
@@ -23,7 +23,7 @@ tls_example.py::
     with pika.BlockingConnection(conn_params) as conn:
         ch = conn.channel()
         ch.queue_declare("foobar")
-        ch.publish("", "foobar", "Hello, world!")
+        ch.basic_publish("", "foobar", "Hello, world!")
         print(ch.basic_get("foobar"))
 
 rabbitmq.config::
diff --git a/docs/version_history.rst b/docs/version_history.rst
index 4dac7da..317b2c1 100644
--- a/docs/version_history.rst
+++ b/docs/version_history.rst
@@ -1,7 +1,7 @@
 Version History
 ===============
 
-1.0.0b2 2019-01-22
+1.0.0b2 2019-02-04
 ------------------
 
 `GitHub milestone <https://github.com/pika/pika/milestone/8>`_
@@ -10,10 +10,10 @@ Version History
 - ``BlockingConnection.consume`` now returns ``(None, None, None)`` when inactivity timeout is reached (`PR <https://github.com/pika/pika/pull/899>`_)
 - Python 3.7 support (`Issue <https://github.com/pika/pika/issues/1107>`_)
 - ``all_channels`` parameter of the ``Channel.basic_qos`` method renamed to ``global_qos``
-
-
-**IMPORTANT**: The signature of the following methods has changed from Pika 0.13.0. In general, the callback parameter that indicates completion of the method has been moved to the end of the parameter list to be consistent with other parts of Pika's API and with other libraries in general.
-
+- **NOTE:** ``heartbeat_interval`` is removed, use ``heartbeat`` instead.
+- **NOTE:** The `backpressure_detection` option of `ConnectionParameters` and `URLParameters` property is REMOVED in favor of `Connection.Blocked` and `Connection.Unblocked`. See `Connection.add_on_connection_blocked_callback`.
+- **NOTE:** The legacy ``basic_publish`` method is removed, and ``publish`` renamed to ``basic_publish``
+- **NOTE**: The signature of the following methods has changed from Pika 0.13.0. In general, the callback parameter that indicates completion of the method has been moved to the end of the parameter list to be consistent with other parts of Pika's API and with other libraries in general.
 - ``basic_cancel``
 - ``basic_consume``
 - ``basic_get``
diff --git a/examples/asynchronous_publisher_example.py b/examples/asynchronous_publisher_example.py
index 163c8a4..8827a99 100644
--- a/examples/asynchronous_publisher_example.py
+++ b/examples/asynchronous_publisher_example.py
@@ -361,7 +361,7 @@ def main():
     logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
 
     # Connect to localhost:5672 as guest with the password guest and virtual host "/" (%2F)
-    example = ExamplePublisher('amqp://guest:guest@localhost:5672/%2F?connection_attempts=3&heartbeat_interval=3600')
+    example = ExamplePublisher('amqp://guest:guest@localhost:5672/%2F?connection_attempts=3&heartbeat=3600')
     example.run()
 
 
diff --git a/examples/heartbeat_and_blocked_timeouts.py b/examples/heartbeat_and_blocked_timeouts.py
index 3fe9a99..52659dc 100644
--- a/examples/heartbeat_and_blocked_timeouts.py
+++ b/examples/heartbeat_and_blocked_timeouts.py
@@ -27,7 +27,7 @@ import pika
 def main():
 
     # NOTE: These paramerers work with all Pika connection types
-    params = pika.ConnectionParameters(heartbeat_interval=600,
+    params = pika.ConnectionParameters(heartbeat=600,
                                        blocked_connection_timeout=300)
 
     conn = pika.BlockingConnection(params)
diff --git a/pika/adapters/blocking_connection.py b/pika/adapters/blocking_connection.py
index dc5ba10..5dc7add 100644
--- a/pika/adapters/blocking_connection.py
+++ b/pika/adapters/blocking_connection.py
@@ -2180,57 +2180,20 @@ class BlockingChannel(object):
                         "wait completed without GetOk and GetEmpty")
                     return None, None, None
 
-    def basic_publish(self, exchange, routing_key, body,
-                      properties=None, mandatory=False, immediate=False):
-        """Publish to the channel with the given exchange, routing key and body.
-        Returns a boolean value indicating the success of the operation.
-
-        This is the legacy BlockingChannel method for publishing. See also
-        `BlockingChannel.publish` that provides more information about failures.
-
-        For more information on basic_publish and what the parameters do, see:
-
-            http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.publish
-
-        NOTE: mandatory and immediate may be enabled even without delivery
-          confirmation, but in the absence of delivery confirmation the
-          synchronous implementation has no way to know how long to wait for
-          the Basic.Return or lack thereof.
-
-        :param exchange: The exchange to publish to
-        :type exchange: str or unicode
-        :param routing_key: The routing key to bind on
-        :type routing_key: str or unicode
-        :param body: The message body; empty string if no body
-        :type body: bytes
-        :param pika.spec.BasicProperties properties: message properties
-        :param bool mandatory: The mandatory flag
-        :param bool immediate: The immediate flag
-
-        :returns: True if delivery confirmation is not enabled (NEW in pika
-            0.10.0); otherwise returns False if the message could not be
-            delivered (Basic.nack and/or Basic.Return) and True if the message
-            was delivered (Basic.ack and no Basic.Return)
-        """
-        try:
-            self.publish(exchange, routing_key, body, properties,
-                         mandatory, immediate)
-        except (exceptions.NackError, exceptions.UnroutableError):
-            return False
-        else:
-            return True
-
-    def publish(self, exchange, routing_key, body,
-                properties=None, mandatory=False, immediate=False):
+    def basic_publish(self,
+                      exchange,
+                      routing_key,
+                      body,
+                      properties=None,
+                      mandatory=False):
         """Publish to the channel with the given exchange, routing key, and
-        body. Unlike the legacy `BlockingChannel.basic_publish`, this method
-        provides more information about failures via exceptions.
+        body.
 
         For more information on basic_publish and what the parameters do, see:
 
             http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.publish
 
-        NOTE: mandatory and immediate may be enabled even without delivery
+        NOTE: mandatory may be enabled even without delivery
           confirmation, but in the absence of delivery confirmation the
           synchronous implementation has no way to know how long to wait for
           the Basic.Return.
@@ -2243,7 +2206,6 @@ class BlockingChannel(object):
         :type body: bytes
         :param pika.spec.BasicProperties properties: message properties
         :param bool mandatory: The mandatory flag
-        :param bool immediate: The immediate flag
 
         :raises UnroutableError: raised when a message published in
             publisher-acknowledgments mode (see
@@ -2261,8 +2223,7 @@ class BlockingChannel(object):
                                          routing_key=routing_key,
                                          body=body,
                                          properties=properties,
-                                         mandatory=mandatory,
-                                         immediate=immediate)
+                                         mandatory=mandatory)
 
                 self._flush_output(self._message_confirmation_result.is_ready)
                 conf_method = (self._message_confirmation_result.value
@@ -2274,9 +2235,9 @@ class BlockingChannel(object):
                     # error
                     LOGGER.warning(
                         "Message was Nack'ed by broker: nack=%r; channel=%s; "
-                        "exchange=%s; routing_key=%s; mandatory=%r; "
-                        "immediate=%r", conf_method, self.channel_number,
-                        exchange, routing_key, mandatory, immediate)
+                        "exchange=%s; routing_key=%s; mandatory=%r; ",
+                        conf_method, self.channel_number,
+                        exchange, routing_key, mandatory)
                     if self._puback_return is not None:
                         returned_messages = [self._puback_return]
                         self._puback_return = None
@@ -2299,8 +2260,7 @@ class BlockingChannel(object):
                                      routing_key=routing_key,
                                      body=body,
                                      properties=properties,
-                                     mandatory=mandatory,
-                                     immediate=immediate)
+                                     mandatory=mandatory)
             self._flush_output()
 
     def basic_qos(self, prefetch_size=0, prefetch_count=0, global_qos=False):
diff --git a/pika/adapters/twisted_connection.py b/pika/adapters/twisted_connection.py
index 176756a..ff0f00f 100644
--- a/pika/adapters/twisted_connection.py
+++ b/pika/adapters/twisted_connection.py
@@ -520,10 +520,12 @@ class TwistedChannel(object):
             requeue=requeue,
         )
 
-    def basic_publish(self, exchange, routing_key, body,
+    def basic_publish(self,
+                      exchange,
+                      routing_key,
+                      body,
                       properties=None,
-                      mandatory=False,
-                      immediate=False):
+                      mandatory=False):
         """Publish to the channel with the given exchange, routing key and body.
 
         This method wraps :meth:`Channel.basic_publish
@@ -542,7 +544,6 @@ class TwistedChannel(object):
         :type body: str or unicode
         :param pika.spec.BasicProperties properties: Basic.properties
         :param bool mandatory: The mandatory flag
-        :param bool immediate: The immediate flag
         :return: A Deferred that fires with the result of the channel's
             basic_publish.
         :rtype: Deferred
@@ -563,9 +564,7 @@ class TwistedChannel(object):
             routing_key=routing_key,
             body=body,
             properties=properties,
-            mandatory=mandatory,
-            immediate=immediate,
-        )
+            mandatory=mandatory)
         if not self._delivery_confirmation:
             return defer.succeed(result)
         else:
diff --git a/pika/channel.py b/pika/channel.py
index e2e28a5..0127ff1 100644
--- a/pika/channel.py
+++ b/pika/channel.py
@@ -403,10 +403,12 @@ class Channel(object):
         return self._send_method(spec.Basic.Nack(delivery_tag, multiple,
                                                  requeue))
 
-    def basic_publish(self, exchange, routing_key, body,
+    def basic_publish(self,
+                      exchange,
+                      routing_key,
+                      body,
                       properties=None,
-                      mandatory=False,
-                      immediate=False):
+                      mandatory=False):
         """Publish to the channel with the given exchange, routing key and body.
         For more information on basic_publish and what the parameters do, see:
 
@@ -420,19 +422,15 @@ class Channel(object):
         :type body: str or unicode
         :param pika.spec.BasicProperties properties: Basic.properties
         :param bool mandatory: The mandatory flag
-        :param bool immediate: The immediate flag
 
         """
         self._raise_if_not_open()
-        if immediate:
-            LOGGER.warning('The immediate flag is deprecated in RabbitMQ')
         if isinstance(body, unicode_type):
             body = body.encode('utf-8')
         properties = properties or spec.BasicProperties()
         self._send_method(spec.Basic.Publish(exchange=exchange,
                                              routing_key=routing_key,
-                                             mandatory=mandatory,
-                                             immediate=immediate),
+                                             mandatory=mandatory),
                           (properties, body))
 
     def basic_qos(self,
diff --git a/pika/connection.py b/pika/connection.py
index 730fc6a..add744d 100644
--- a/pika/connection.py
+++ b/pika/connection.py
@@ -28,8 +28,6 @@ from pika.compat import (xrange, basestring, # pylint: disable=W0622
                          dict_iteritems)
 
 
-BACKPRESSURE_WARNING = ("Pika: Write buffer exceeded warning threshold at "
-                        "%i bytes and an estimated %i frames behind")
 PRODUCT = "Pika Python Client Library"
 
 LOGGER = logging.getLogger(__name__)
@@ -43,7 +41,6 @@ class Parameters(object):  # pylint: disable=R0902
     # Declare slots to protect against accidental assignment of an invalid
     # attribute
     __slots__ = (
-        '_backpressure_detection',
         '_blocked_connection_timeout',
         '_channel_max',
         '_client_properties',
@@ -65,7 +62,6 @@ class Parameters(object):  # pylint: disable=R0902
     DEFAULT_USERNAME = 'guest'
     DEFAULT_PASSWORD = 'guest'
 
-    DEFAULT_BACKPRESSURE_DETECTION = False
     DEFAULT_BLOCKED_CONNECTION_TIMEOUT = None
     DEFAULT_CHANNEL_MAX = pika.channel.MAX_CHANNELS
     DEFAULT_CLIENT_PROPERTIES = None
@@ -86,12 +82,7 @@ class Parameters(object):  # pylint: disable=R0902
     DEFAULT_VIRTUAL_HOST = '/'
     DEFAULT_TCP_OPTIONS = None
 
-    DEFAULT_HEARTBEAT_INTERVAL = DEFAULT_HEARTBEAT_TIMEOUT # DEPRECATED
-
     def __init__(self):
-        self._backpressure_detection = None
-        self.backpressure_detection = self.DEFAULT_BACKPRESSURE_DETECTION
-
         # If not None, blocked_connection_timeout is the timeout, in seconds,
         # for the connection to remain blocked; if the timeout expires, the
         # connection will be torn down, triggering the connection's
@@ -166,27 +157,6 @@ class Parameters(object):  # pylint: disable=R0902
             return not result
         return NotImplemented
 
-    @property
-    def backpressure_detection(self):
-        """
-        :returns: boolean indicating whether backpressure detection is
-            enabled. Defaults to `DEFAULT_BACKPRESSURE_DETECTION`.
-
-        """
-        return self._backpressure_detection
-
-    @backpressure_detection.setter
-    def backpressure_detection(self, value):
-        """
-        :param bool value: boolean indicating whether to enable backpressure
-            detection
-
-        """
-        if not isinstance(value, bool):
-            raise TypeError('backpressure_detection must be a bool, '
-                            'but got %r' % (value,))
-        self._backpressure_detection = value
-
     @property
     def blocked_connection_timeout(self):
         """
@@ -592,7 +562,6 @@ class ConnectionParameters(Parameters):
                  socket_timeout=_DEFAULT,
                  stack_timeout=_DEFAULT,
                  locale=_DEFAULT,
-                 backpressure_detection=_DEFAULT,
                  blocked_connection_timeout=_DEFAULT,
                  client_properties=_DEFAULT,
                  tcp_options=_DEFAULT,
@@ -623,9 +592,6 @@ class ConnectionParameters(Parameters):
             (TCP/[SSL]/AMQP) bring-up timeout in seconds. It's recommended to
             set this value higher than `socket_timeout`.
         :param str locale: Set the locale value
-        :param bool backpressure_detection: DEPRECATED in favor of
-            `Connection.Blocked` and `Connection.Unblocked`. See
-            `Connection.add_on_connection_blocked_callback`.
         :param blocked_connection_timeout: If not None,
             the value is a non-negative timeout, in seconds, for the
             connection to remain blocked (triggered by Connection.Blocked from
@@ -638,15 +604,10 @@ class ConnectionParameters(Parameters):
         :param client_properties: None or dict of client properties used to
             override the fields in the default client properties reported to
             RabbitMQ via `Connection.StartOk` method.
-        :param heartbeat_interval: DEPRECATED; use `heartbeat` instead, and
-            don't pass both
         :param tcp_options: None or a dict of TCP options to set for socket
         """
         super(ConnectionParameters, self).__init__()
 
-        if backpressure_detection is not self._DEFAULT:
-            self.backpressure_detection = backpressure_detection
-
         if blocked_connection_timeout is not self._DEFAULT:
             self.blocked_connection_timeout = blocked_connection_timeout
 
@@ -668,19 +629,6 @@ class ConnectionParameters(Parameters):
         if heartbeat is not self._DEFAULT:
             self.heartbeat = heartbeat
 
-        try:
-            heartbeat_interval = kwargs.pop('heartbeat_interval')
-        except KeyError:
-            # Good, this one is deprecated
-            pass
-        else:
-            warnings.warn('heartbeat_interval is deprecated, use heartbeat',
-                          DeprecationWarning, stacklevel=2)
-            if heartbeat is not self._DEFAULT:
-                raise TypeError('heartbeat and deprecated heartbeat_interval '
-                                'are mutually-exclusive')
-            self.heartbeat = heartbeat_interval
-
         if host is not self._DEFAULT:
             self.host = host
 
@@ -727,10 +675,6 @@ class URLParameters(Parameters):
 
     Valid query string values are:
 
-        - backpressure_detection:
-            DEPRECATED in favor of
-            `Connection.Blocked` and `Connection.Unblocked`. See
-            `Connection.add_on_connection_blocked_callback`.
         - channel_max:
             Override the default maximum channel count value
         - client_properties:
@@ -848,15 +792,6 @@ class URLParameters(Parameters):
 
             set_value(value)
 
-    def _set_url_backpressure_detection(self, value):
-        """Deserialize and apply the corresponding query string arg"""
-        try:
-            backpressure_detection = {'t': True, 'f': False}[value]
-        except KeyError:
-            raise ValueError('Invalid backpressure_detection value: %r' %
-                             (value,))
-        self.backpressure_detection = backpressure_detection
-
     def _set_url_blocked_connection_timeout(self, value):
         """Deserialize and apply the corresponding query string arg"""
         try:
@@ -897,32 +832,12 @@ class URLParameters(Parameters):
 
     def _set_url_heartbeat(self, value):
         """Deserialize and apply the corresponding query string arg"""
-        if 'heartbeat_interval' in self._all_url_query_values:
-            raise ValueError('Deprecated URL parameter heartbeat_interval must '
-                             'not be specified together with heartbeat')
-
         try:
             heartbeat_timeout = int(value)
         except ValueError as exc:
             raise ValueError('Invalid heartbeat value %r: %r' % (value, exc,))
         self.heartbeat = heartbeat_timeout
 
-    def _set_url_heartbeat_interval(self, value):
-        """Deserialize and apply the corresponding query string arg"""
-        warnings.warn('heartbeat_interval is deprecated, use heartbeat',
-                      DeprecationWarning, stacklevel=2)
-
-        if 'heartbeat' in self._all_url_query_values:
-            raise ValueError('Deprecated URL parameter heartbeat_interval must '
-                             'not be specified together with heartbeat')
-
-        try:
-            heartbeat_timeout = int(value)
-        except ValueError as exc:
-            raise ValueError('Invalid heartbeat_interval value %r: %r' %
-                             (value, exc,))
-        self.heartbeat = heartbeat_timeout
-
     def _set_url_locale(self, value):
         """Deserialize and apply the corresponding query string arg"""
         self.locale = value
@@ -1048,7 +963,6 @@ class Connection(pika.compat.AbstractBase):
     # Disable pylint messages concerning "method could be a funciton"
     # pylint: disable=R0201
 
-    ON_CONNECTION_BACKPRESSURE = '_on_connection_backpressure'
     ON_CONNECTION_CLOSED = '_on_connection_closed'
     ON_CONNECTION_ERROR = '_on_connection_error'
     ON_CONNECTION_OPEN_OK = '_on_connection_open_ok'
@@ -1145,7 +1059,6 @@ class Connection(pika.compat.AbstractBase):
         self.known_hosts = None
         self._frame_buffer = None
         self._channels = None
-        self._backpressure_multiplier = None
 
         self._init_connection_state()
 
@@ -1205,9 +1118,6 @@ class Connection(pika.compat.AbstractBase):
         self.frames_received = 0
         self._heartbeat_checker = None
 
-        # Default back-pressure multiplier value
-        self._backpressure_multiplier = 10
-
         # When closing, holds reason why
         self._error = None
 
@@ -1234,17 +1144,6 @@ class Connection(pika.compat.AbstractBase):
             self.add_on_connection_unblocked_callback(
                 self._on_connection_unblocked)
 
-    def add_backpressure_callback(self, callback):
-        """Call method "callback" when pika believes backpressure is being
-        applied.
-
-        :param method callback: The method to call
-
-        """
-        validators.require_callback(callback)
-        self.callbacks.add(0, self.ON_CONNECTION_BACKPRESSURE, callback,
-                           False)
-
     def add_on_close_callback(self, callback):
         """Add a callback notification when the connection has closed. The
         callback will be passed the connection and an exception instance. The
@@ -1417,17 +1316,6 @@ class Connection(pika.compat.AbstractBase):
                 LOGGER.info(
                     'Connection.close is waiting for %d channels to close: %s',
                     len(self._channels), self)
-
-    def set_backpressure_multiplier(self, value=10):
-        """Alter the backpressure multiplier value. We set this to 10 by default.
-        This value is used to raise warnings and trigger the backpressure
-        callback.
-
-        :param int value: The multiplier value to set
-
-        """
-        self._backpressure_multiplier = value
-
     #
     # Connection state properties
     #
@@ -1661,15 +1549,6 @@ class Connection(pika.compat.AbstractBase):
             if not (chan.is_closing or chan.is_closed):
                 chan.close(reply_code, reply_text)
 
-    def _connect(self):
-        """Attempt to connect to RabbitMQ
-
-        :rtype: bool
-
-        """
-        warnings.warn('This method is deprecated, use Connection.connect',
-                      DeprecationWarning)
-
     def _create_channel(self, channel_number, on_open_callback):
         """Create a new channel using the specified channel number and calling
         back the method specified by on_open_callback
@@ -1722,19 +1601,6 @@ class Connection(pika.compat.AbstractBase):
         # pylint: disable=W0212
         self._channels[value.channel_number]._handle_content_frame(value)
 
-    def _detect_backpressure(self):
-        """Attempt to calculate if TCP backpressure is being applied due to
-        our outbound buffer being larger than the average frame size over
-        a window of frames.
-
-        """
-        avg_frame_size = self.bytes_sent / self.frames_sent
-        buffer_size = self._adapter_get_write_buffer_size()
-        if buffer_size > (avg_frame_size * self._backpressure_multiplier):
-            LOGGER.warning(BACKPRESSURE_WARNING, buffer_size,
-                           int(buffer_size / avg_frame_size))
-            self.callbacks.process(0, self.ON_CONNECTION_BACKPRESSURE, self)
-
     def _ensure_closed(self):
         """If the connection is not closed, close it."""
         if self.is_open:
@@ -2439,5 +2305,3 @@ class Connection(pika.compat.AbstractBase):
             self.bytes_sent += len(marshaled_frame)
             self.frames_sent += 1
             self._adapter_emit_data(marshaled_frame)
-        if self.params.backpressure_detection:
-            self._detect_backpressure()
diff --git a/pika/exceptions.py b/pika/exceptions.py
index ca28ed8..29b5541 100644
--- a/pika/exceptions.py
+++ b/pika/exceptions.py
@@ -335,26 +335,6 @@ class ChannelError(Exception):
             self.__class__.__name__)
 
 
-class InvalidMinimumFrameSize(ProtocolSyntaxError):
-    """ DEPRECATED; pika.connection.Parameters.frame_max property setter now
-    raises the standard `ValueError` exception when the value is out of bounds.
-    """
-
-    def __repr__(self):
-        return '%s: AMQP Minimum Frame Size is 4096 Bytes' % (
-            self.__class__.__name__)
-
-
-class InvalidMaximumFrameSize(ProtocolSyntaxError):
-    """ DEPRECATED; pika.connection.Parameters.frame_max property setter now
-    raises the standard `ValueError` exception when the value is out of bounds.
-    """
-
-    def __repr__(self):
-        return '%s: AMQP Maximum Frame Size is 131072 Bytes' % (
-            self.__class__.__name__)
-
-
 class ReentrancyError(Exception):
     """The requested operation would result in unsupported recursion or
     reentrancy.


Test patch:
diff --git a/tests/acceptance/blocking_adapter_test.py b/tests/acceptance/blocking_adapter_test.py
index 5815ef1..20607bd 100644
--- a/tests/acceptance/blocking_adapter_test.py
+++ b/tests/acceptance/blocking_adapter_test.py
@@ -338,7 +338,7 @@ class TestCreateAndCloseConnectionWithChannelAndConsumer(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Publish the message to the queue by way of default exchange
-        ch.publish(exchange='', routing_key=q_name, body=body1)
+        ch.basic_publish(exchange='', routing_key=q_name, body=body1)
 
         # Create a consumer that uses automatic ack mode
         ch.basic_consume(q_name, lambda *x: None, auto_ack=True,
@@ -860,7 +860,7 @@ class TestExchangeBindAndUnbind(BlockingTestCaseBase):
 
         # Verify that the queue is unreachable without exchange-exchange binding
         with self.assertRaises(pika.exceptions.UnroutableError):
-            ch.publish(src_exg_name, routing_key, body='', mandatory=True)
+            ch.basic_publish(src_exg_name, routing_key, body='', mandatory=True)
 
         # Bind the exchanges
         frame = ch.exchange_bind(destination=dest_exg_name, source=src_exg_name,
@@ -868,7 +868,7 @@ class TestExchangeBindAndUnbind(BlockingTestCaseBase):
         self.assertIsInstance(frame.method, pika.spec.Exchange.BindOk)
 
         # Publish a message via the source exchange
-        ch.publish(src_exg_name, routing_key, body='TestExchangeBindAndUnbind',
+        ch.basic_publish(src_exg_name, routing_key, body='TestExchangeBindAndUnbind',
                    mandatory=True)
 
         # Check that the queue now has one message
@@ -884,7 +884,7 @@ class TestExchangeBindAndUnbind(BlockingTestCaseBase):
 
         # Verify that the queue is now unreachable via the source exchange
         with self.assertRaises(pika.exceptions.UnroutableError):
-            ch.publish(src_exg_name, routing_key, body='', mandatory=True)
+            ch.basic_publish(src_exg_name, routing_key, body='', mandatory=True)
 
 
 class TestQueueDeclareAndDelete(BlockingTestCaseBase):
@@ -969,7 +969,7 @@ class TestQueueBindAndUnbindAndPurge(BlockingTestCaseBase):
         self.assertEqual(frame.method.message_count, 0)
 
         # Deposit a message in the queue
-        ch.publish(exg_name, routing_key, body='TestQueueBindAndUnbindAndPurge',
+        ch.basic_publish(exg_name, routing_key, body='TestQueueBindAndUnbindAndPurge',
                    mandatory=True)
 
         # Check that the queue now has one message
@@ -983,7 +983,7 @@ class TestQueueBindAndUnbindAndPurge(BlockingTestCaseBase):
 
         # Verify that the queue is now unreachable via that binding
         with self.assertRaises(pika.exceptions.UnroutableError):
-            ch.publish(exg_name, routing_key,
+            ch.basic_publish(exg_name, routing_key,
                        body='TestQueueBindAndUnbindAndPurge-2',
                        mandatory=True)
 
@@ -1032,7 +1032,7 @@ class TestBasicGet(BlockingTestCaseBase):
 
         body = 'TestBasicGet'
         # Deposit a message in the queue via default exchange
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body=body,
                    mandatory=True)
         LOGGER.info('%s PUBLISHED (%s)', datetime.utcnow(), self)
@@ -1081,10 +1081,10 @@ class TestBasicReject(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Deposit two messages in the queue via default exchange
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicReject1',
                    mandatory=True)
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicReject2',
                    mandatory=True)
 
@@ -1127,10 +1127,10 @@ class TestBasicRejectNoRequeue(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Deposit two messages in the queue via default exchange
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicRejectNoRequeue1',
                    mandatory=True)
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicRejectNoRequeue2',
                    mandatory=True)
 
@@ -1172,10 +1172,10 @@ class TestBasicNack(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Deposit two messages in the queue via default exchange
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicNack1',
                    mandatory=True)
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicNack2',
                    mandatory=True)
 
@@ -1218,10 +1218,10 @@ class TestBasicNackNoRequeue(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Deposit two messages in the queue via default exchange
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicNackNoRequeue1',
                    mandatory=True)
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicNackNoRequeue2',
                    mandatory=True)
 
@@ -1263,10 +1263,10 @@ class TestBasicNackMultiple(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Deposit two messages in the queue via default exchange
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicNackMultiple1',
                    mandatory=True)
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicNackMultiple2',
                    mandatory=True)
 
@@ -1319,10 +1319,10 @@ class TestBasicRecoverWithRequeue(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Deposit two messages in the queue via default exchange
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicRecoverWithRequeue1',
                    mandatory=True)
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestBasicRecoverWithRequeue2',
                    mandatory=True)
 
@@ -1371,7 +1371,7 @@ class TestTxCommit(BlockingTestCaseBase):
         self.assertIsInstance(frame.method, pika.spec.Tx.SelectOk)
 
         # Deposit a message in the queue via default exchange
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestTxCommit1',
                    mandatory=True)
 
@@ -1409,7 +1409,7 @@ class TestTxRollback(BlockingTestCaseBase):
         self.assertIsInstance(frame.method, pika.spec.Tx.SelectOk)
 
         # Deposit a message in the queue via default exchange
-        ch.publish(exchange='', routing_key=q_name,
+        ch.basic_publish(exchange='', routing_key=q_name,
                    body='TestTxRollback1',
                    mandatory=True)
 
@@ -1462,16 +1462,11 @@ class TestPublishAndBasicPublishWithPubacksUnroutable(BlockingTestCaseBase):
         self.addCleanup(connection.channel().exchange_delete, exg_name)
 
         # Verify unroutable message handling using basic_publish
-        res = ch.basic_publish(exg_name, routing_key=routing_key, body='',
-                               mandatory=True)
-        self.assertEqual(res, False)
-
-        # Verify unroutable message handling using publish
         msg2_headers = dict(
             test_name='TestPublishAndBasicPublishWithPubacksUnroutable')
         msg2_properties = pika.spec.BasicProperties(headers=msg2_headers)
         with self.assertRaises(pika.exceptions.UnroutableError) as cm:
-            ch.publish(exg_name, routing_key=routing_key, body='',
+            ch.basic_publish(exg_name, routing_key=routing_key, body='',
                        properties=msg2_properties, mandatory=True)
         (msg,) = cm.exception.messages
         self.assertIsInstance(msg, blocking_connection.ReturnedMessage)
@@ -1505,9 +1500,8 @@ class TestConfirmDeliveryAfterUnroutableMessage(BlockingTestCaseBase):
         ch.add_on_return_callback(lambda *args: returned_messages.append(args))
 
         # Emit unroutable message without pubacks
-        res = ch.basic_publish(exg_name, routing_key=routing_key, body='',
-                               mandatory=True)
-        self.assertEqual(res, True)
+        ch.basic_publish(exg_name, routing_key=routing_key, body='',
+                         mandatory=True)
 
         # Select delivery confirmations
         ch.confirm_delivery()
@@ -1558,10 +1552,10 @@ class TestUnroutableMessagesReturnedInNonPubackMode(BlockingTestCaseBase):
             lambda *args: returned_messages.append(args))
 
         # Emit unroutable messages without pubacks
-        ch.publish(exg_name, routing_key=routing_key, body='msg1',
+        ch.basic_publish(exg_name, routing_key=routing_key, body='msg1',
                    mandatory=True)
 
-        ch.publish(exg_name, routing_key=routing_key, body='msg2',
+        ch.basic_publish(exg_name, routing_key=routing_key, body='msg2',
                    mandatory=True)
 
         # Process I/O until Basic.Return are dispatched
@@ -1618,13 +1612,12 @@ class TestUnroutableMessageReturnedInPubackMode(BlockingTestCaseBase):
             lambda *args: returned_messages.append(args))
 
         # Emit unroutable messages with pubacks
-        res = ch.basic_publish(exg_name, routing_key=routing_key, body='msg1',
-                               mandatory=True)
-        self.assertEqual(res, False)
-
-        res = ch.basic_publish(exg_name, routing_key=routing_key, body='msg2',
-                               mandatory=True)
-        self.assertEqual(res, False)
+        with self.assertRaises(pika.exceptions.UnroutableError):
+            ch.basic_publish(exg_name, routing_key=routing_key, body='msg1',
+                            mandatory=True)
+        with self.assertRaises(pika.exceptions.UnroutableError):
+            ch.basic_publish(exg_name, routing_key=routing_key, body='msg2',
+                            mandatory=True)
 
         # Verify that unroutable messages are already in pending events
         self.assertEqual(len(ch._pending_events), 2)
@@ -1688,19 +1681,17 @@ class TestBasicPublishDeliveredWhenPendingUnroutable(BlockingTestCaseBase):
         ch.queue_bind(q_name, exchange=exg_name, routing_key=routing_key)
 
         # Attempt to send an unroutable message in the queue via basic_publish
-        res = ch.basic_publish(exg_name, routing_key='',
-                               body='unroutable-message',
-                               mandatory=True)
-        self.assertEqual(res, True)
+        ch.basic_publish(exg_name, routing_key='',
+                         body='unroutable-message',
+                         mandatory=True)
 
         # Flush connection to force Basic.Return
         connection.channel().close()
 
         # Deposit a routable message in the queue
-        res = ch.basic_publish(exg_name, routing_key=routing_key,
-                               body='routable-message',
-                               mandatory=True)
-        self.assertEqual(res, True)
+        ch.basic_publish(exg_name, routing_key=routing_key,
+                         body='routable-message',
+                         mandatory=True)
 
         # Wait for the queue to get the routable message
         self._assert_exact_message_count_with_retries(channel=ch,
@@ -1763,19 +1754,18 @@ class TestPublishAndConsumeWithPubacksAndQosOfOne(BlockingTestCaseBase):
         # Bind the queue to the exchange using routing key
         ch.queue_bind(q_name, exchange=exg_name, routing_key=routing_key)
 
-        # Deposit a message in the queue via basic_publish
+        # Deposit a message in the queue
         msg1_headers = dict(
             test_name='TestPublishAndConsumeWithPubacksAndQosOfOne')
         msg1_properties = pika.spec.BasicProperties(headers=msg1_headers)
-        res = ch.basic_publish(exg_name, routing_key=routing_key,
-                               body='via-basic_publish',
-                               properties=msg1_properties,
-                               mandatory=True)
-        self.assertEqual(res, True)
-
-        # Deposit another message in the queue via publish
-        ch.publish(exg_name, routing_key, body='via-publish',
-                   mandatory=True)
+        ch.basic_publish(exg_name, routing_key=routing_key,
+                         body='via-basic_publish',
+                         properties=msg1_properties,
+                         mandatory=True)
+
+        # Deposit another message in the queue
+        ch.basic_publish(exg_name, routing_key, body='via-publish',
+                         mandatory=True)
 
         # Check that the queue now has two messages
         frame = ch.queue_declare(q_name, passive=True)
@@ -1903,8 +1893,8 @@ class TestBasicConsumeWithAckFromAnotherThread(BlockingTestCaseBase):
         ch.queue_bind(q_name, exchange=exg_name, routing_key=routing_key)
 
         # Publish 2 messages with mandatory=True for synchronous processing
-        ch.publish(exg_name, routing_key, body='msg1', mandatory=True)
-        ch.publish(exg_name, routing_key, body='last-msg', mandatory=True)
+        ch.basic_publish(exg_name, routing_key, body='msg1', mandatory=True)
+        ch.basic_publish(exg_name, routing_key, body='last-msg', mandatory=True)
 
         # Configure QoS for one message so that the 2nd message will be
         # delivered only after the 1st one is ACKed
@@ -2001,8 +1991,8 @@ class TestConsumeGeneratorWithAckFromAnotherThread(BlockingTestCaseBase):
         ch.queue_bind(q_name, exchange=exg_name, routing_key=routing_key)
 
         # Publish 2 messages with mandatory=True for synchronous processing
-        ch.publish(exg_name, routing_key, body='msg1', mandatory=True)
-        ch.publish(exg_name, routing_key, body='last-msg', mandatory=True)
+        ch.basic_publish(exg_name, routing_key, body='msg1', mandatory=True)
+        ch.basic_publish(exg_name, routing_key, body='last-msg', mandatory=True)
 
         # Configure QoS for one message so that the 2nd message will be
         # delivered only after the 1st one is ACKed
@@ -2094,13 +2084,13 @@ class TestTwoBasicConsumersOnSameChannel(BlockingTestCaseBase):
         q1_tx_message_bodies = ['q1_message+%s' % (i,)
                                 for i in pika.compat.xrange(100)]
         for message_body in q1_tx_message_bodies:
-            ch.publish(exg_name, q1_routing_key, body=message_body,
+            ch.basic_publish(exg_name, q1_routing_key, body=message_body,
                        mandatory=True)
 
         q2_tx_message_bodies = ['q2_message+%s' % (i,)
                                 for i in pika.compat.xrange(150)]
         for message_body in q2_tx_message_bodies:
-            ch.publish(exg_name, q2_routing_key, body=message_body,
+            ch.basic_publish(exg_name, q2_routing_key, body=message_body,
                        mandatory=True)
 
         # Create the consumers
@@ -2178,7 +2168,7 @@ class TestBasicCancelPurgesPendingConsumerCancellationEvt(BlockingTestCaseBase):
 
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
-        ch.publish('', routing_key=q_name, body='via-publish', mandatory=True)
+        ch.basic_publish('', routing_key=q_name, body='via-publish', mandatory=True)
 
         # Create a consumer. Not passing a 'callback' to test client-generated
         # consumer tags
@@ -2237,21 +2227,19 @@ class TestBasicPublishWithoutPubacks(BlockingTestCaseBase):
         # Bind the queue to the exchange using routing key
         ch.queue_bind(q_name, exchange=exg_name, routing_key=routing_key)
 
-        # Deposit a message in the queue via basic_publish and mandatory=True
+        # Deposit a message in the queue with mandatory=True
         msg1_headers = dict(
             test_name='TestBasicPublishWithoutPubacks')
         msg1_properties = pika.spec.BasicProperties(headers=msg1_headers)
-        res = ch.basic_publish(exg_name, routing_key=routing_key,
-                               body='via-basic_publish_mandatory=True',
-                               properties=msg1_properties,
-                               mandatory=True)
-        self.assertEqual(res, True)
-
-        # Deposit a message in the queue via basic_publish and mandatory=False
-        res = ch.basic_publish(exg_name, routing_key=routing_key,
-                               body='via-basic_publish_mandatory=False',
-                               mandatory=False)
-        self.assertEqual(res, True)
+        ch.basic_publish(exg_name, routing_key=routing_key,
+                         body='via-basic_publish_mandatory=True',
+                         properties=msg1_properties,
+                         mandatory=True)
+
+        # Deposit a message in the queue with mandatory=False
+        ch.basic_publish(exg_name, routing_key=routing_key,
+                         body='via-basic_publish_mandatory=False',
+                         mandatory=False)
 
         # Wait for the messages to arrive in queue
         self._assert_exact_message_count_with_retries(channel=ch,
@@ -2357,14 +2345,14 @@ class TestPublishFromBasicConsumeCallback(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(dest_q_name))
 
         # Deposit a message in the source queue
-        ch.publish('',
-                   routing_key=src_q_name,
-                   body='via-publish',
-                   mandatory=True)
+        ch.basic_publish('',
+                         routing_key=src_q_name,
+                         body='via-publish',
+                         mandatory=True)
 
         # Create a consumer
         def on_consume(channel, method, props, body):
-            channel.publish(
+            channel.basic_publish(
                 '', routing_key=dest_q_name, body=body,
                 properties=props, mandatory=True)
             channel.basic_ack(method.delivery_tag)
@@ -2404,15 +2392,15 @@ class TestStopConsumingFromBasicConsumeCallback(BlockingTestCaseBase):
         self.addCleanup(connection.channel().queue_delete, q_name)
 
         # Deposit two messages in the queue
-        ch.publish('',
-                   routing_key=q_name,
-                   body='via-publish1',
-                   mandatory=True)
+        ch.basic_publish('',
+                         routing_key=q_name,
+                         body='via-publish1',
+                         mandatory=True)
 
-        ch.publish('',
-                   routing_key=q_name,
-                   body='via-publish2',
-                   mandatory=True)
+        ch.basic_publish('',
+                         routing_key=q_name,
+                         body='via-publish2',
+                         mandatory=True)
 
         # Create a consumer
         def on_consume(channel, method, props, body):  # pylint: disable=W0613
@@ -2460,15 +2448,15 @@ class TestCloseChannelFromBasicConsumeCallback(BlockingTestCaseBase):
         self.addCleanup(connection.channel().queue_delete, q_name)
 
         # Deposit two messages in the queue
-        ch.publish('',
-                   routing_key=q_name,
-                   body='via-publish1',
-                   mandatory=True)
+        ch.basic_publish('',
+                         routing_key=q_name,
+                         body='via-publish1',
+                         mandatory=True)
 
-        ch.publish('',
-                   routing_key=q_name,
-                   body='via-publish2',
-                   mandatory=True)
+        ch.basic_publish('',
+                         routing_key=q_name,
+                         body='via-publish2',
+                         mandatory=True)
 
         # Create a consumer
         def on_consume(channel, method, props, body):  # pylint: disable=W0613
@@ -2514,15 +2502,15 @@ class TestCloseConnectionFromBasicConsumeCallback(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Deposit two messages in the queue
-        ch.publish('',
-                   routing_key=q_name,
-                   body='via-publish1',
-                   mandatory=True)
+        ch.basic_publish('',
+                         routing_key=q_name,
+                         body='via-publish1',
+                         mandatory=True)
 
-        ch.publish('',
-                   routing_key=q_name,
-                   body='via-publish2',
-                   mandatory=True)
+        ch.basic_publish('',
+                         routing_key=q_name,
+                         body='via-publish2',
+                         mandatory=True)
 
         # Create a consumer
         def on_consume(channel, method, props, body):  # pylint: disable=W0613
@@ -2636,7 +2624,7 @@ class TestNonPubAckPublishAndConsumeHugeMessage(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Publish a message to the queue by way of default exchange
-        ch.publish(exchange='', routing_key=q_name, body=body)
+        ch.basic_publish(exchange='', routing_key=q_name, body=body)
         LOGGER.info('Published message body size=%s', len(body))
 
         # Consume the message
@@ -2688,7 +2676,7 @@ class TestNonPubAckPublishAndConsumeManyMessages(BlockingTestCaseBase):
 
         for _ in pika.compat.xrange(num_messages_to_publish):
             # Publish a message to the queue by way of default exchange
-            ch.publish(exchange='', routing_key=q_name, body=body)
+            ch.basic_publish(exchange='', routing_key=q_name, body=body)
 
         # Consume the messages
         num_consumed = 0
@@ -2745,8 +2733,8 @@ class TestBasicCancelWithNonAckableConsumer(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Publish two messages to the queue by way of default exchange
-        ch.publish(exchange='', routing_key=q_name, body=body1)
-        ch.publish(exchange='', routing_key=q_name, body=body2)
+        ch.basic_publish(exchange='', routing_key=q_name, body=body1)
+        ch.basic_publish(exchange='', routing_key=q_name, body=body2)
 
         # Wait for queue to contain both messages
         self._assert_exact_message_count_with_retries(channel=ch,
@@ -2802,8 +2790,8 @@ class TestBasicCancelWithAckableConsumer(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Publish two messages to the queue by way of default exchange
-        ch.publish(exchange='', routing_key=q_name, body=body1)
-        ch.publish(exchange='', routing_key=q_name, body=body2)
+        ch.basic_publish(exchange='', routing_key=q_name, body=body1)
+        ch.basic_publish(exchange='', routing_key=q_name, body=body2)
 
         # Wait for queue to contain both messages
         self._assert_exact_message_count_with_retries(channel=ch,
@@ -2854,8 +2842,8 @@ class TestUnackedMessageAutoRestoredToQueueOnChannelClose(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Publish two messages to the queue by way of default exchange
-        ch.publish(exchange='', routing_key=q_name, body=body1)
-        ch.publish(exchange='', routing_key=q_name, body=body2)
+        ch.basic_publish(exchange='', routing_key=q_name, body=body1)
+        ch.basic_publish(exchange='', routing_key=q_name, body=body2)
 
         # Consume the events, but don't ack
         rx_messages = []
@@ -2901,8 +2889,8 @@ class TestNoAckMessageNotRestoredToQueueOnChannelClose(BlockingTestCaseBase):
         self.addCleanup(lambda: self._connect().channel().queue_delete(q_name))
 
         # Publish two messages to the queue by way of default exchange
-        ch.publish(exchange='', routing_key=q_name, body=body1)
-        ch.publish(exchange='', routing_key=q_name, body=body2)
+        ch.basic_publish(exchange='', routing_key=q_name, body=body1)
+        ch.basic_publish(exchange='', routing_key=q_name, body=body2)
 
         # Consume, but don't ack
         num_messages = 0
diff --git a/tests/acceptance/twisted_adapter_tests.py b/tests/acceptance/twisted_adapter_tests.py
index 0ba8a67..3572e33 100644
--- a/tests/acceptance/twisted_adapter_tests.py
+++ b/tests/acceptance/twisted_adapter_tests.py
@@ -416,7 +416,7 @@ class TwistedChannelTestCase(TestCase):
             # Args are converted to kwargs
             exchange=args[0],
             # Defaults
-            immediate=False, mandatory=False, properties=None,
+            mandatory=False, properties=None,
         ))
         self.pika_channel.basic_publish.assert_called_once_with(
             **kwargs)
diff --git a/tests/unit/channel_tests.py b/tests/unit/channel_tests.py
index f0eefa0..a60af03 100644
--- a/tests/unit/channel_tests.py
+++ b/tests/unit/channel_tests.py
@@ -536,23 +536,6 @@ class ChannelTests(unittest.TestCase):
         self.assertRaises(exceptions.ChannelWrongStateError,
                           self.obj.basic_publish, 'foo', 'bar', 'baz')
 
-    @mock.patch('pika.channel.LOGGER')
-    @mock.patch('pika.spec.Basic.Publish')
-    @mock.patch('pika.channel.Channel._send_method')
-    def test_immediate_called_logger_warning(self, _send_method, _unused,
-                                             logger):
-        self.obj._set_state(self.obj.OPEN)
-        exchange = 'basic_publish_test'
-        routing_key = 'routing-key-fun'
-        body = b'This is my body'
-        properties = spec.BasicProperties(content_type='text/plain')
-        mandatory = False
-        immediate = True
-        self.obj.basic_publish(exchange, routing_key, body, properties,
-                               mandatory, immediate)
-        logger.warning.assert_called_once_with('The immediate flag is '
-                                               'deprecated in RabbitMQ')
-
     @mock.patch('pika.spec.Basic.Publish')
     @mock.patch('pika.channel.Channel._send_method')
     def test_basic_publish_send_method_request(self, send_method, _unused):
@@ -562,15 +545,13 @@ class ChannelTests(unittest.TestCase):
         body = b'This is my body'
         properties = spec.BasicProperties(content_type='text/plain')
         mandatory = False
-        immediate = False
         self.obj.basic_publish(exchange, routing_key, body, properties,
-                               mandatory, immediate)
+                               mandatory)
         send_method.assert_called_once_with(
             spec.Basic.Publish(
                 exchange=exchange,
                 routing_key=routing_key,
-                mandatory=mandatory,
-                immediate=immediate), (properties, body))
+                mandatory=mandatory), (properties, body))
 
     def test_basic_qos_raises_channel_wrong_state(self):
         self.assertRaises(exceptions.ChannelWrongStateError,
diff --git a/tests/unit/connection_parameters_tests.py b/tests/unit/connection_parameters_tests.py
index f693ec0..9fa0502 100644
--- a/tests/unit/connection_parameters_tests.py
+++ b/tests/unit/connection_parameters_tests.py
@@ -53,8 +53,6 @@ class ParametersTestsBase(unittest.TestCase):
         """
         kls = connection.Parameters
         defaults = {
-            'backpressure_detection':
-            kls.DEFAULT_BACKPRESSURE_DETECTION,
             'blocked_connection_timeout':
             kls.DEFAULT_BLOCKED_CONNECTION_TIMEOUT,
             'channel_max':
@@ -202,24 +200,6 @@ class ParametersTests(ParametersTestsBase):
     def test_default_property_values(self):
         self.assert_default_parameter_values(connection.Parameters())
 
-    def test_backpressure_detection(self):
-        params = connection.Parameters()
-
-        params.backpressure_detection = False
-        self.assertEqual(params.backpressure_detection, False)
-
-        params.backpressure_detection = True
-        self.assertEqual(params.backpressure_detection, True)
-
-        with self.assertRaises(TypeError):
-            params.backpressure_detection = 1
-
-        with self.assertRaises(TypeError):
-            params.backpressure_detection = 'true'
-
-        with self.assertRaises(TypeError):
-            params.backpressure_detection = 'f'
-
     def test_blocked_connection_timeout(self):
         params = connection.Parameters()
 
@@ -530,7 +510,6 @@ class ConnectionParametersTests(ParametersTestsBase):
     def test_good_connection_parameters(self):
         """make sure connection kwargs get set correctly"""
         kwargs = {
-            'backpressure_detection': False,
             'blocked_connection_timeout': 10.5,
             'channel_max': 3,
             'client_properties': {
@@ -570,17 +549,6 @@ class ConnectionParametersTests(ParametersTestsBase):
                 msg='Expected %s=%r, but got %r' %
                 (t_param, expected_values[t_param], value))
 
-    def test_deprecated_heartbeat_interval(self):
-        with warnings.catch_warnings(record=True) as warnings_list:
-            warnings.simplefilter('always')
-
-            params = connection.ConnectionParameters(heartbeat_interval=999)
-            self.assertEqual(params.heartbeat, 999)
-
-            # Check that a warning was generated
-            self.assertEqual(len(warnings_list), 1)
-            self.assertIs(warnings_list[0].category, DeprecationWarning)
-
     def test_callable_heartbeat(self):
         def heartbeat_callback(_connection, _broker_val):
             return 1
@@ -596,7 +564,6 @@ class ConnectionParametersTests(ParametersTestsBase):
             'channel_max': 3,
             'frame_max': 40000,
             'heartbeat': 7,
-            'backpressure_detection': False,
             'ssl': True,
             'blocked_connection_timeout': 10.5
         }
@@ -613,7 +580,6 @@ class ConnectionParametersTests(ParametersTestsBase):
                 ('socket_timeout', '42'),
                 ('stack_timeout', '99'),
                 ('retry_delay', 'two'),
-                ('backpressure_detection', 'true'),
                 ('ssl', {'ssl': 'dict'}),
                 ('ssl_options', True),
                 ('connection_attempts', 'hello'),
@@ -701,53 +667,34 @@ class URLParametersTests(ParametersTestsBase):
             }
         }
 
-        for backpressure in ('t', 'f'):
-            test_params = dict(query_args)
-            test_params['backpressure_detection'] = backpressure
-            virtual_host = '/'
-            query_string = urlencode(test_params)
-            test_url = ('amqp://myuser:mypass@www.test.com:5678/%s?%s' % (
-                url_quote(virtual_host, safe=''),
-                query_string,
-            ))
-
-            params = connection.URLParameters(test_url)
-
-            # check all value from query string
-
-            for t_param in query_args:
-                expected_value = query_args[t_param]
-                actual_value = getattr(params, t_param)
-
-                self.assertEqual(
-                    actual_value,
-                    expected_value,
-                    msg='Expected %s=%r, but got %r' %
-                    (t_param, expected_value, actual_value))
-
-            self.assertEqual(params.backpressure_detection,
-                             backpressure == 't')
-
-            # check all values from base URL
-            self.assertEqual(params.credentials.username, 'myuser')
-            self.assertEqual(params.credentials.password, 'mypass')
-            self.assertEqual(params.host, 'www.test.com')
-            self.assertEqual(params.port, 5678)
-            self.assertEqual(params.virtual_host, virtual_host)
-
-    def test_deprecated_heartbeat_interval(self):
-        with warnings.catch_warnings(record=True) as warnings_list:
-            warnings.simplefilter('always')
-
-            params = pika.URLParameters(
-                'amqp://prtfqpeo:oihdglkhcp0@myserver.'
-                'mycompany.com:5672/prtfqpeo?heartbeat_interval=999')
-
-            self.assertEqual(params.heartbeat, 999)
-
-            # Check that a warning was generated
-            self.assertEqual(len(warnings_list), 1)
-            self.assertIs(warnings_list[0].category, DeprecationWarning)
+        test_params = dict(query_args)
+        virtual_host = '/'
+        query_string = urlencode(test_params)
+        test_url = ('amqp://myuser:mypass@www.test.com:5678/%s?%s' % (
+            url_quote(virtual_host, safe=''),
+            query_string,
+        ))
+
+        params = connection.URLParameters(test_url)
+
+        # check all value from query string
+
+        for t_param in query_args:
+            expected_value = query_args[t_param]
+            actual_value = getattr(params, t_param)
+
+            self.assertEqual(
+                actual_value,
+                expected_value,
+                msg='Expected %s=%r, but got %r' %
+                (t_param, expected_value, actual_value))
+
+        # check all values from base URL
+        self.assertEqual(params.credentials.username, 'myuser')
+        self.assertEqual(params.credentials.password, 'mypass')
+        self.assertEqual(params.host, 'www.test.com')
+        self.assertEqual(params.port, 5678)
+        self.assertEqual(params.virtual_host, virtual_host)
 
     def test_accepts_plain_string(self):
         parameters = pika.URLParameters('amqp://prtfqpeo:oihdglkhcp0@myserver.'
diff --git a/tests/unit/connection_tests.py b/tests/unit/connection_tests.py
index 438633c..995bfd7 100644
--- a/tests/unit/connection_tests.py
+++ b/tests/unit/connection_tests.py
@@ -314,8 +314,6 @@ class ConnectionTests(unittest.TestCase):  # pylint: disable=R0904
         """make sure the callback adding works"""
         self.connection.callbacks = mock.Mock(spec=self.connection.callbacks)
         for test_method, expected_key in (
-            (self.connection.add_backpressure_callback,
-             self.connection.ON_CONNECTION_BACKPRESSURE),
             (self.connection.add_on_open_callback,
              self.connection.ON_CONNECTION_OPEN_OK),
             (self.connection.add_on_close_callback,
@@ -448,12 +446,6 @@ class ConnectionTests(unittest.TestCase):  # pylint: disable=R0904
 
         self.assertDictEqual(conn._client_properties, expectation)
 
-    def test_set_backpressure_multiplier(self):
-        """test setting the backpressure multiplier"""
-        self.connection._backpressure_multiplier = None
-        self.connection.set_backpressure_multiplier(value=5)
-        self.assertEqual(5, self.connection._backpressure_multiplier)
-
     def test_close_channels(self):
         """test closing all channels"""
         self.connection.connection_state = self.connection.CONNECTION_OPEN
@@ -982,10 +974,6 @@ class ConnectionTests(unittest.TestCase):  # pylint: disable=R0904
         self.assertEqual(self.connection.frames_sent, frames_sent)
         self.assertEqual(self.connection.bytes_sent, bytes_sent)
 
-        # Make sure _detect_backpressure doesn't throw
-        self.connection._detect_backpressure()
-
-
     def test_no_side_effects_from_message_marshal_error(self):
         # Verify that frame buffer is empty on entry
         self.assertEqual(b'', self.connection._frame_buffer)
diff --git a/tests/unit/exceptions_test.py b/tests/unit/exceptions_test.py
index e88da00..ab58e41 100644
--- a/tests/unit/exceptions_test.py
+++ b/tests/unit/exceptions_test.py
@@ -37,16 +37,6 @@ class ExceptionTests(unittest.TestCase):
             'BodyTooLongError: Received too many bytes for a message delivery: '
             'Received 100, expected 50')
 
-    def test_invalid_minimum_frame_size_repr(self):
-        self.assertEqual(
-            repr(exceptions.InvalidMinimumFrameSize()),
-            'InvalidMinimumFrameSize: AMQP Minimum Frame Size is 4096 Bytes')
-
-    def test_invalid_maximum_frame_size_repr(self):
-        self.assertEqual(
-            repr(exceptions.InvalidMaximumFrameSize()),
-            'InvalidMaximumFrameSize: AMQP Maximum Frame Size is 131072 Bytes')
-
     def test_channel_closed_properties_positional_args(self):
         exc = exceptions.ChannelClosed(9, 'args abcd')
         self.assertEqual(exc.reply_code, 9)