LocalClusteredQueue nonDurable5 = new LocalClusteredQueue(office4, 4, "nondurable5", im.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
LocalClusteredQueue nonDurable5 = new LocalClusteredQueue(office4, 4, "nondurable5", channelIdManager.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);
   protected void routeComplexTopic(boolean persistent) throws Throwable   {      ClusteredPostOffice office1 = null;            ClusteredPostOffice office2 = null;            ClusteredPostOffice office3 = null;            ClusteredPostOffice office4 = null;            ClusteredPostOffice office5 = null;            ClusteredPostOffice office6 = null;            ClusteredPostOffice office7 = null;              try      {            office1 = createClusteredPostOffice(1, "testgroup");         office2 = createClusteredPostOffice(2, "testgroup");         office3 = createClusteredPostOffice(3, "testgroup");         office4 = createClusteredPostOffice(4, "testgroup");         office5 = createClusteredPostOffice(5, "testgroup");         office6 = createClusteredPostOffice(6, "testgroup");         office7 = createClusteredPostOffice(7, "testgroup");                  //Node 2         //======                  //Non durable 1 on node 2         LocalClusteredQueue nonDurable1 = new LocalClusteredQueue(office2, 2, "nondurable1", im.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);         Binding binding1 = office2.bindClusteredQueue("topic", nonDurable1);         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         nonDurable1.add(receiver1);                  //Non durable 2 on node 2         LocalClusteredQueue nonDurable2 = new LocalClusteredQueue(office2, 2, "nondurable2", im.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);         Binding binding2 = office2.bindClusteredQueue("topic", nonDurable2);         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         nonDurable2.add(receiver2);                  //Node 3         //======                  //Non shared durable         LocalClusteredQueue nonSharedDurable1 = new LocalClusteredQueue(office3, 3, "nonshareddurable1", im.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);         Binding binding3 = office3.bindClusteredQueue("topic", nonSharedDurable1);         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         nonSharedDurable1.add(receiver3);                  //Non durable         LocalClusteredQueue nonDurable3 = new LocalClusteredQueue(office3, 3, "nondurable3", im.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);         Binding binding4 = office3.bindClusteredQueue("topic", nonDurable3);         SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         nonDurable3.add(receiver4);                  //Node 4         //======                  //Shared durable         LocalClusteredQueue sharedDurable1 = new LocalClusteredQueue(office4, 4, "shareddurable1", im.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);         Binding binding5 = office4.bindClusteredQueue("topic", sharedDurable1);         SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         sharedDurable1.add(receiver5);                  //Non shared durable         LocalClusteredQueue nonSharedDurable2 = new LocalClusteredQueue(office4, 4, "nonshareddurable2", im.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);         Binding binding6 = office4.bindClusteredQueue("topic", nonSharedDurable2);         SimpleReceiver receiver6 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         nonSharedDurable2.add(receiver6);                  //Non durable         LocalClusteredQueue nonDurable4 = new LocalClusteredQueue(office4, 4, "nondurable4", im.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);         Binding binding7 = office4.bindClusteredQueue("topic", nonDurable4);         SimpleReceiver receiver7 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         nonDurable4.add(receiver7);                  // Non durable         LocalClusteredQueue nonDurable5 = new LocalClusteredQueue(office4, 4, "nondurable5", im.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);         Binding binding8 = office4.bindClusteredQueue("topic", nonDurable5);         SimpleReceiver receiver8 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         nonDurable5.add(receiver8);                  //Non durable         LocalClusteredQueue nonDurable6 = new LocalClusteredQueue(office4, 4, "nondurable6", im.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);         Binding binding9 = office4.bindClusteredQueue("topic", nonDurable6);         SimpleReceiver receiver9 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         nonDurable6.add(receiver9);                  // Node 5         //=======         //Shared durable         LocalClusteredQueue sharedDurable2 = new LocalClusteredQueue(office5, 5, "shareddurable1", im.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);         Binding binding10 = office5.bindClusteredQueue("topic", sharedDurable2);         SimpleReceiver receiver10 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         sharedDurable2.add(receiver10);                  //Shared durable         LocalClusteredQueue sharedDurable3 = new LocalClusteredQueue(office5, 5, "shareddurable2", im.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);         Binding binding11 = office5.bindClusteredQueue("topic", sharedDurable3);         SimpleReceiver receiver11 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         sharedDurable3.add(receiver11);                  // Node 6         //=========         LocalClusteredQueue sharedDurable4 = new LocalClusteredQueue(office6, 6, "shareddurable2", im.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);         Binding binding12 = office6.bindClusteredQueue("topic", sharedDurable4);         SimpleReceiver receiver12 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         sharedDurable4.add(receiver12);                  LocalClusteredQueue nonDurable7 = new LocalClusteredQueue(office6, 6, "nondurable7", im.getId(), ms, pm, true, false, (QueuedExecutor)pool.get(), null, tr);         Binding binding13 = office6.bindClusteredQueue("topic", nonDurable7);         SimpleReceiver receiver13 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         nonDurable7.add(receiver13);                  //Node 7         //=======         LocalClusteredQueue sharedDurable5 = new LocalClusteredQueue(office7, 7, "shareddurable2", im.getId(), ms, pm, true, true, (QueuedExecutor)pool.get(), null, tr);         Binding binding14 = office7.bindClusteredQueue("topic", sharedDurable5);         SimpleReceiver receiver14 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);         sharedDurable5.add(receiver14);                           //Send 1 message at node1         //========================                  List msgs = sendMessages("topic", persistent, office1, 1, null);                  //n2         checkContainsAndAcknowledge(msgs, receiver1, nonDurable1);         checkContainsAndAcknowledge(msgs, receiver2, nonDurable2);                  //n3         checkContainsAndAcknowledge(msgs, receiver3, nonSharedDurable1);         checkContainsAndAcknowledge(msgs, receiver4, nonDurable3);                  //n4         checkContainsAndAcknowledge(msgs, receiver5, sharedDurable1);         checkContainsAndAcknowledge(msgs, receiver6, nonSharedDurable2);         checkContainsAndAcknowledge(msgs, receiver7, nonDurable4);         checkContainsAndAcknowledge(msgs, receiver8, nonDurable5);         checkContainsAndAcknowledge(msgs, receiver9, nonDurable6);                  //n5         checkEmpty(receiver10);         checkContainsAndAcknowledge(msgs, receiver11, sharedDurable3);                  //n6         checkEmpty(receiver12);         checkContainsAndAcknowledge(msgs, receiver13, nonDurable7);                  //n7         checkEmpty(receiver12);                           //Send 1 message at node2         //========================                  msgs = sendMessages("topic", persistent, office2, 1, null);                  //n2         checkContainsAndAcknowledge(msgs, receiver1, nonDurable1);         checkContainsAndAcknowledge(msgs, receiver2, nonDurable2);                  //n3         checkContainsAndAcknowledge(msgs, receiver3, nonSharedDurable1);         checkContainsAndAcknowledge(msgs, receiver4, nonDurable3);                  //n4         checkContainsAndAcknowledge(msgs, receiver5, sharedDurable1);         checkContainsAndAcknowledge(msgs, receiver6, nonSharedDurable2);         checkContainsAndAcknowledge(msgs, receiver7, nonDurable4);         checkContainsAndAcknowledge(msgs, receiver8, nonDurable5);         checkContainsAndAcknowledge(msgs, receiver9, nonDurable6);                  //n5         checkEmpty(receiver10);         checkContainsAndAcknowledge(msgs, receiver11, sharedDurable3);                  //n6         checkEmpty(receiver12);         checkContainsAndAcknowledge(msgs, receiver13, nonDurable7);                  //n7         checkEmpty(receiver12);                  //Send 1 message at node3         //========================                  msgs = sendMessages("topic", persistent, office3, 1, null);                  //n2         checkContainsAndAcknowledge(msgs, receiver1, nonDurable1);         checkContainsAndAcknowledge(msgs, receiver2, nonDurable2);                  //n3         checkContainsAndAcknowledge(msgs, receiver3, nonSharedDurable1);         checkContainsAndAcknowledge(msgs, receiver4, nonDurable3);                  //n4         checkContainsAndAcknowledge(msgs, receiver5, sharedDurable1);         checkContainsAndAcknowledge(msgs, receiver6, nonSharedDurable2);         checkContainsAndAcknowledge(msgs, receiver7, nonDurable4);         checkContainsAndAcknowledge(msgs, receiver8, nonDurable5);         checkContainsAndAcknowledge(msgs, receiver9, nonDurable6);                  //n5         checkEmpty(receiver10);         checkContainsAndAcknowledge(msgs, receiver11, sharedDurable3);                  //n6         checkEmpty(receiver12);         checkContainsAndAcknowledge(msgs, receiver13, nonDurable7);                  //n7         checkEmpty(receiver12);                       //Send 1 message at node4         //========================                      msgs = sendMessages("topic", persistent, office4, 1, null);                        //n2         checkContainsAndAcknowledge(msgs, receiver1, nonDurable1);         checkContainsAndAcknowledge(msgs, receiver2, nonDurable2);                  //n3         checkContainsAndAcknowledge(msgs, receiver3, nonSharedDurable1);         checkContainsAndAcknowledge(msgs, receiver4, nonDurable3);                  //n4         checkContainsAndAcknowledge(msgs, receiver5, sharedDurable1);         checkContainsAndAcknowledge(msgs, receiver6, nonSharedDurable2);         checkContainsAndAcknowledge(msgs, receiver7, nonDurable4);         checkContainsAndAcknowledge(msgs, receiver8, nonDurable5);         checkContainsAndAcknowledge(msgs, receiver9, nonDurable6);                  //n5         checkEmpty(receiver10);                  checkContainsAndAcknowledge(msgs, receiver11, sharedDurable3);                  //n6         checkEmpty(receiver12);         checkContainsAndAcknowledge(msgs, receiver13, nonDurable7);                  //n7         checkEmpty(receiver12);                  //Send 1 message at node5         //========================                  msgs = sendMessages("topic", persistent, office5, 1, null);                      //n2         checkContainsAndAcknowledge(msgs, receiver1, nonDurable1);         checkContainsAndAcknowledge(msgs, receiver2, nonDurable2);                  //n3         checkContainsAndAcknowledge(msgs, receiver3, nonSharedDurable1);         checkContainsAndAcknowledge(msgs, receiver4, nonDurable3);                  //n4         checkEmpty(receiver5);         checkContainsAndAcknowledge(msgs, receiver6, nonSharedDurable2);         checkContainsAndAcknowledge(msgs, receiver7, nonDurable4);         checkContainsAndAcknowledge(msgs, receiver8, nonDurable5);         checkContainsAndAcknowledge(msgs, receiver9, nonDurable6);                  //n5         checkContainsAndAcknowledge(msgs, receiver10, sharedDurable2);         checkContainsAndAcknowledge(msgs, receiver11, sharedDurable3);                  //n6         checkEmpty(receiver12);         checkContainsAndAcknowledge(msgs, receiver13, nonDurable7);                  //n7         checkEmpty(receiver12);                  //Send 1 message at node6         //========================                  msgs = sendMessages("topic", persistent, office6, 1, null);                      //n2         checkContainsAndAcknowledge(msgs, receiver1, nonDurable1);         checkContainsAndAcknowledge(msgs, receiver2, nonDurable2);                  //n3         checkContainsAndAcknowledge(msgs, receiver3, nonSharedDurable1);         checkContainsAndAcknowledge(msgs, receiver4, nonDurable3);                  //n4         checkContainsAndAcknowledge(msgs, receiver5, sharedDurable1);         checkContainsAndAcknowledge(msgs, receiver6, nonSharedDurable2);         checkContainsAndAcknowledge(msgs, receiver7, nonDurable4);         checkContainsAndAcknowledge(msgs, receiver8, nonDurable5);         checkContainsAndAcknowledge(msgs, receiver9, nonDurable6);                  //n5         checkEmpty(receiver10);                 checkEmpty(receiver11);                  //n6         checkContainsAndAcknowledge(msgs, receiver12, sharedDurable4);                  checkContainsAndAcknowledge(msgs, receiver13, nonDurable7);                  //n7         checkEmpty(receiver12);                  //Send 1 message at node7         //========================                  msgs = sendMessages("topic", persistent, office7, 1, null);         //n2         checkContainsAndAcknowledge(msgs, receiver1, nonDurable1);         checkContainsAndAcknowledge(msgs, receiver2, nonDurable2);                  //n3         checkContainsAndAcknowledge(msgs, receiver3, nonSharedDurable1);         checkContainsAndAcknowledge(msgs, receiver4, nonDurable3);                  //n4         checkContainsAndAcknowledge(msgs, receiver5, sharedDurable1);         checkContainsAndAcknowledge(msgs, receiver6, nonSharedDurable2);         checkContainsAndAcknowledge(msgs, receiver7, nonDurable4);         checkContainsAndAcknowledge(msgs, receiver8, nonDurable5);         checkContainsAndAcknowledge(msgs, receiver9, nonDurable6);                  //n5         checkEmpty(receiver10);         checkEmpty(receiver11);                  //n6         checkEmpty(receiver12);         checkContainsAndAcknowledge(msgs, receiver13, nonDurable7);                  //n7         checkContainsAndAcknowledge(msgs, receiver14, sharedDurable5);              }      finally      {         if (office1 != null)         {                        office1.stop();         }                  if (office2 != null)         {            office2.stop();         }                  if (office3 != null)         {                        try            {               office3.unbindClusteredQueue("nonshareddurable1");            }            catch (Exception ignore)            {                  ignore.printStackTrace();            }            office3.stop();         }                  if (office4 != null)         {            try            {               office4.unbindClusteredQueue("shareddurable1");               office4.unbindClusteredQueue("nonshareddurable2");            }            catch (Exception ignore)            {                          ignore.printStackTrace();            }            office4.stop();         }                  if (office5 != null)         {                  try            {               office5.unbindClusteredQueue("shareddurable1");               office5.unbindClusteredQueue("shareddurable2");            }            catch (Exception ignore)            {                              ignore.printStackTrace();            }            office5.stop();         }                  if (office6 != null)         {                     try            {               office6.unbindClusteredQueue("shareddurable2");            }            catch (Exception ignore)            {                              ignore.printStackTrace();            }            office6.stop();         }                  if (office7 != null)         {                  try            {               office7.unbindClusteredQueue("shareddurable2");            }            catch (Exception ignore)            {                              ignore.printStackTrace();            }            office7.stop();         }                  checkNoMessageData();      }   }