Connection c = null;
try {
c = persistenceAdapter.getConnection();
adapter.doRecoverSubscription(c, subscription.getPersistentKey(), destinationName, new MessageListResultHandler() {
public void onMessage(long seq, String messageID) throws JMSException {
MessageIdentity messageIdentity = new MessageIdentity(messageID, new Long(seq));
ActiveMQMessage message = getMessage(messageIdentity);
subscription.addMessage(container, message);
}
});
}