}
public void recoverNextMessages(String clientId, String subscriptionName, int maxReturned, MessageRecoveryListener listener) throws Exception {
EntityManager manager = adapter.beginEntityManager(null);
try {
SubscriptionId id = new SubscriptionId();
id.setClientId(clientId);
id.setSubscriptionName(subscriptionName);
id.setDestination(destinationName);
AtomicLong last = subscriberLastMessageMap.get(id);
if (last == null) {
StoredSubscription ss = findStoredSubscription(manager, clientId, subscriptionName);
last = new AtomicLong(ss.getLastAckedId());