diff --git a/carrot/backends/pyamqplib.py b/carrot/backends/pyamqplib.py
index <HASH>..<HASH> 100644
--- a/carrot/backends/pyamqplib.py
+++ b/carrot/backends/pyamqplib.py
@@ -172,6 +172,8 @@ class Backend(BaseBackend):
     def establish_connection(self):
         """Establish connection to the AMQP broker."""
         conninfo = self.connection
+        if not conninfo.hostname:
+            raise KeyError("Missing hostname for AMQP connection.")
         if not conninfo.port:
             conninfo.port = self.default_port
         return Connection(host=conninfo.host,
amqplib: Raise KeyError if hostname isn't set, for a more friendly  error message.