Examples of StoredSubscription


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

    public SubscriptionInfo lookupSubscription(String clientId, String subscriptionName) throws IOException {
        SubscriptionInfo rc = null;
        EntityManager manager = adapter.beginEntityManager(null);
        try {
            StoredSubscription ss = findStoredSubscription(manager, clientId, subscriptionName);
            if (ss != null) {
                rc = new SubscriptionInfo();
                rc.setClientId(ss.getClientId());
                rc.setDestination(destination);
                rc.setSelector(ss.getSelector());
                rc.setSubscriptionName(ss.getSubscriptionName());
                rc.setSubscribedDestination(toSubscribedDestination(ss));
            }
        } catch (Throwable e) {
            adapter.rollbackEntityManager(null, manager);
            throw IOExceptionSupport.create(e);
View Full Code Here

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

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

    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
Copyright © 2018 www.massapi.com. 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.