                   sendPackets packets, (err) ->
                     chai.expect(err).to.not.exist
 
+
+      describe 'multiple inqueues bound to one outqueue', ->
+        it 'data sent on outqueue shows up on all inqueues', (done) ->
+          @timeout 3000
+          senders = [ 'sender' ]
+          receivers = ['r1', 'r2', 'r3']
+          clientNames = common.clone receivers
+          clientNames.push.apply clientNames, senders
+          createConnectClients address, clientNames, (err, clients) ->
+            chai.expect(err).to.not.exist
+
+            expect = [ {q:'r1',d:'ident'}, {q:'r2',d:'ident'}, {q:'r3',d:'ident'} ]
+
+            received = []
+            checkExpected = (q, msg) ->
+              received.push { q: q, d: msg.data.data }
+              if received.length == expect.length
+                received.sort (a,b) ->
+                  return -1 if a.q < b.q
+                  return 1 if a.q > b.q
+                  return 0
+                chai.expect(received).to.eql expect
+                done()
+
+            onReceives =
+              r1: (msg) -> checkExpected 'r1', msg
+              r2: (msg) -> checkExpected 'r2', msg
+              r3: (msg) -> checkExpected 'r3', msg
+
+            outQueue2 = 'outqueue39'
+            clients.sender.createQueue 'outqueue', outQueue2, (err) ->
+              chai.expect(err).to.not.exist
+
+              # Bind same outqueue to all inqueues
+              queueMapping = []
+              for name in receivers
+                queueMapping.push [ clients[name], 'inqueue', outQueue2, name ]
+              createBindQueues broker, queueMapping, (err) ->
+                chai.expect(err).to.not.exist
+
+                handlers = []
+                for name in receivers
+                  handlers.push [ clients[name], name, onReceives[name] ]
+                subscribeData handlers, (err) ->
+                  chai.expect(err).to.not.exist
+                  clients.sender.sendToQueue outQueue2, {data: 'ident'}, (err) ->
+                    chai.expect(err).to.not.exist
+


createBindQueues = (broker, queueMapping, callback) ->
  createBindQueue = (det, cb) ->
    [client, srcQ, tgtQ] = det
    client.createQueue 'outqueue', srcQ, (err) ->
      return cb err if err
      broker.bindQueue srcQ, tgtQ, cb


          sender = transport.getClient address
          receiver = transport.getClient address
          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()
