code: public String listenDurable(Topic topic,
                                  String messageSelector,
                                  MessageListener callback,
                                  String subscriptionName)
              throws MessagingException {
          try {
              String clientId = connection.getClientID();
              if (clientId == null) {
                  throw new MessagingException("A non-null client ID must be provided upon "
                          + "creation of a JMSManager in order to create a JMS connection "
                          + "capable of creating durable subscriptions.");
              }
              if (subscriptionName == null) {
                  subscriptionName = topic.getTopicName();
              }
  
              Session s =
                      connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
              MessageConsumer c =
                      s.createDurableSubscriber(topic, subscriptionName, messageSelector, false);
              c.setMessageListener(callback);
              durableSubscriptions.put(subscriptionName, c);
          } catch (JMSException e) {
              throw new MessagingException(e.getMessage(), e);
          }
  
          if (logger.isDebugEnabled()) {
              logger.debug("listen() - Asynchronous durable listen on topic " + topic);
          }
  
          return subscriptionName;
      }
docs: This is an asynchronous and durable listen. The caller provides a JMS
  callback interface reference, and any messages received for the given
  destination are provided through the onMessage() callback method. If the
  listener becomes unavailable the JMS provider will store messages
  received on the given topic until the listener reestablishes a connection
  and will then deliver those messages.
  Messages will be filtered based on the provided message selector.
  
  @param topic
  the topic on which to listen
  @param messageSelector
  selection criteria for filtering messages
  @param callback
  the listener to call when a message is received
  @param subscriptionName
  the name of the subscription
  @return The subscription name which can be used to stop, unsubscribe,
  and reconnect to this topic
  @throws MessagingException