       ret[nc[0]] = nc[1]
     return callback null, ret
 
+createQueues = (queueMapping, callback) ->
+  createQueue = (det, cb) ->
+    [client, type, queueName] = det
+    client.removeQueue type, queueName, (err) ->
+      return cb err if err
+      client.createQueue type, queueName, cb
+
+  async.map queueMapping, createQueue, callback
+
 createBindQueues = (broker, queueMapping, callback) ->
   createBindQueue = (det, cb) ->
     [client, type, srcQ, tgtQ] = det
     createQ = if type == 'outqueue' then srcQ else tgtQ
-    client.createQueue type, createQ, (err) ->
+    client.removeQueue type, createQ, (err) ->
       return cb err if err
-      broker.addBinding {type:'pubsub', src:srcQ, tgt:tgtQ}, cb
+      client.createQueue type, createQ, (err) ->
+        return cb err if err
+        broker.addBinding {type:'pubsub', src:srcQ, tgt:tgtQ}, cb
 
   async.map queueMapping, createBindQueue, callback
 

      payload = { foo: 'bar99' }
      inQueue = 'inqueue232'
      outQueue = 'outqueue353'
      onReceive = (msg) ->
        receiver.ackMessage msg
        chai.expect(msg).to.include.keys 'data'
        chai.expect(msg.data).to.eql payload
        done()
      createConnectClients ['sender', 'receiver'], (err) ->
        clients.receiver.createQueue 'inqueue', inQueue, (err) ->
          chai.expect(err).to.be.a 'null'
          clients.sender.createQueue 'outqueue', outQueue, (err) ->
            chai.expect(err).to.be.a 'null'

          broker.addBinding {type:'pubsub', src:outQueue, tgt:inQueue}, (err) ->
            chai.expect(err).to.be.a 'null'

        chai.expect(msg).to.include.keys 'data'
        chai.expect(msg.data).to.eql payload
        done()
      createConnectClients address, ['sender', 'receiver'], (err, clients) ->
        createQueues [
          [ clients.receiver, 'inqueue', sharedQueue ]
          [ clients.sender, 'outqueue', sharedQueue ]
        ], (err) ->
          chai.expect(err).to.not.exist

          broker.addBinding {type:'pubsub', src:sharedQueue, tgt:sharedQueue}, (err) ->
            chai.expect(err).to.be.a 'null'
