concept connection in category rabbitmq

appears as: connections, Connection, Connection, connection
RabbitMQ in Depth

This is an excerpt from Manning's book RabbitMQ in Depth.

Additionally, if you’re setting up on a Windows machine, you may be prompted by your firewall to allow connections to and from the VM. Make sure you allow this, or you’ll be unable to connect to the VM, and Vagrant won’t even be able to configure it.

import rabbitpy

with rabbitpy.Connection() as connection:                       1
    with connection.channel() as channel:                       2
        queue = rabbitpy.Queue(channel, 'test-messages')        3
        queue.declare()                                         4
        while True:                                             5
            message = queue.get()                               6
            if message:                                         7
                message.pprint()
                message.ack()                                   8
                if message.body == 'stop':                      9
                    break
import rabbitpy

with rabbitpy.Connection() as connection:                    1
    with connection.channel() as channel:                    2
        queue = rabbitpy.Queue(channel, 'durable-queue', 
                               durable=True)                 3
        if queue.declare():                                  4
            print('Queue declared')