Package org.activemq.service

Examples of org.activemq.service.MessageIdentity


    /**
     * @see org.activemq.store.TopicMessageStore#getLastestMessageIdentity()
     */
    public MessageIdentity getLastestMessageIdentity() throws JMSException {
        return new MessageIdentity(null, new Long(sequenceGenerator.getLastSequenceId()));
    }
View Full Code Here


        Connection c = null;
        try {
            c = persistenceAdapter.getConnection();
            adapter.doRecoverSubscription(c, destinationName, subscriptionId, new MessageListResultHandler() {
                public void onMessage(long seq, String messageID) throws JMSException {
                    MessageIdentity messageIdentity = new MessageIdentity(messageID, new Long(seq));
                    listener.recoverMessage(messageIdentity);
                }
            });
        }
        catch (SQLException e) {
View Full Code Here

                        String subscription = is.readUTF();
                        String messageId = is.readUTF();
                       
                        JournalTopicMessageStore store = (JournalTopicMessageStore) createMessageStore(destination, false);
                        try {                           
                            store.getLongTermTopicMessageStore().setLastAcknowledgedMessageIdentity(subscription, new MessageIdentity(messageId));
                        }
                        catch (Throwable e) {
                            log.error("Recovery Failure: Could not ack message: " + messageId + ", reason: " + e, e);
                        }
                       
View Full Code Here

            throw JMSExceptionHelper.newJMSException("Failed to broker message: " + messageID + " in container: " + e, e);
        } finally {
          persistenceAdapter.returnConnection(c);
        }

        MessageIdentity answer = message.getJMSMessageIdentity();
        answer.setSequenceNumber(new Long(seq));
    }
View Full Code Here

        Connection c = null;
        try {
            c = persistenceAdapter.getConnection();           
            adapter.doRecover(c, destinationName, new MessageListResultHandler() {
                public void onMessage(long seq, String messageID) throws JMSException {
                    listener.recoverMessage(new MessageIdentity(messageID, new Long(seq)));               
                }
            });    
           
        } catch (SQLException e) {
            throw JMSExceptionHelper.newJMSException("Failed to recover container. Reason: " + e, e);
View Full Code Here

        final RecordLocation location = peristenceAdapter.writePacket(destinationName, message, message.isReceiptRequired());
        TransactionManager.getContexTransaction().addPostCommitTask(new TransactionTask(){
            public void execute() throws Throwable {
                synchronized (JournalMessageStore.this) {
                    nextMark = location;
                    MessageIdentity id = message.getJMSMessageIdentity();
                    addedMessageIds.put(id, location);
                }
            }
        });
    }
View Full Code Here

        final RecordLocation ackLocation = peristenceAdapter.writePacket(destinationName, ack, ack.isReceiptRequired());       
        TransactionManager.getContexTransaction().addPostCommitTask(new TransactionTask(){
            public void execute() throws Throwable {
                synchronized (JournalMessageStore.this) {
                    nextMark = ackLocation;
                    MessageIdentity id = ack.getMessageIdentity();
                    if (addedMessageIds.remove(id) == null) {
                        removedMessageLocations.add(ack);
                    }
                }
            }
View Full Code Here

            public void execute() throws Throwable {

                // Checkpoint the added messages.
                Iterator iterator = cpAddedMessageIds.keySet().iterator();
                while (iterator.hasNext()) {
                    MessageIdentity identity = (MessageIdentity) iterator.next();
                    ActiveMQMessage msg = getCacheMessage(identity);
                    // Pull it out of the journal if we have to.
                    if (msg == null) {
                        RecordLocation location = (RecordLocation) cpAddedMessageIds.get(identity);
                        msg = (ActiveMQMessage) peristenceAdapter.readPacket((RecordLocation) location);
View Full Code Here

       
        // Checkpoint the acked messages.
        Iterator iterator = cpAckedLastAckLocations.keySet().iterator();
        while (iterator.hasNext()) {         
            String subscription = (String) iterator.next();
            MessageIdentity identity = (MessageIdentity) cpAckedLastAckLocations.get(subscription);           
          longTermStore.setLastAcknowledgedMessageIdentity(subscription, identity);
        }       
       
      }
View Full Code Here

TOP

Related Classes of org.activemq.service.MessageIdentity

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.