Package org.apache.activemq.store.jpa.model

Examples of org.apache.activemq.store.jpa.model.StoredSubscription


            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());
                subscriberLastMessageMap.put(id, last);
            }
            final AtomicLong lastMessageId = last;

            Query query = manager.createQuery("select m from StoredMessageReference m where m.destination=?1 and m.id>?2 order by m.id asc");
View Full Code Here


    public void recoverSubscription(String clientId, String subscriptionName, MessageRecoveryListener listener) throws Exception {
        EntityManager manager = adapter.beginEntityManager(null);
        try {

            StoredSubscription ss = findStoredSubscription(manager, clientId, subscriptionName);

            Query query = manager.createQuery("select m from StoredMessageReference m where m.destination=?1 and m.id>?2 order by m.id asc");
            query.setParameter(1, destinationName);
            query.setParameter(2, ss.getLastAckedId());
            for (StoredMessageReference m : (List<StoredMessageReference>)query.getResultList()) {
                MessageId mid = new MessageId(m.getMessageId());
                mid.setBrokerSequenceId(m.getId());
                listener.recoverMessageReference(mid);
            }
View Full Code Here

TOP

Related Classes of org.apache.activemq.store.jpa.model.StoredSubscription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.