Connection conn1 = cf.createConnection();   conn1.setClientID(CLIENT_ID1);   Session sess1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer prod = sess1.createProducer(topic); prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);  MessageConsumer durable = sess1.createDurableSubscriber(topic, "mySubscription");  conn1.start();  final int NUM_MESSAGES = 50;  for (int i = 0; i < NUM_MESSAGES; i++)
Connection conn1 = null;  try
   public void testDurableSubscriptionSimple() throws Exception   {      final String CLIENT_ID1 = "test-client-id1";      Connection conn1 = cf.createConnection();      conn1.setClientID(CLIENT_ID1);      Session sess1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);      MessageProducer prod = sess1.createProducer(topic);      prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);      MessageConsumer durable = sess1.createDurableSubscriber(topic, "mySubscription");      conn1.start();      final int NUM_MESSAGES = 50;      for (int i = 0; i < NUM_MESSAGES; i++)      {         TextMessage tm = sess1.createTextMessage("hello");         prod.send(topic, tm);      }      int count = 0;      while (true)      {         TextMessage tm = (TextMessage)durable.receive(3000);         if (tm == null)         {            break;         }         count++;      }      assertEquals(NUM_MESSAGES, count);      sess1.unsubscribe("mySubscription");      conn1.close();   }