@Override public boolean equals(Object obj) { if (obj == this) { return true; } return obj instanceof AsyncJobKey && id.equals(((AsyncJobKey) obj).id) && destination.equals(((AsyncJobKey) obj).destination); }
public void rollbackPendingCursorAdditions(MessageId messageId) { synchronized (indexOrderedCursorUpdates) { for (int i = indexOrderedCursorUpdates.size() - 1; i >= 0; i--) { MessageContext mc = indexOrderedCursorUpdates.get(i); if (mc.message.getMessageId().equals(messageId)) { indexOrderedCursorUpdates.remove(mc); if (mc.onCompletion != null) { mc.onCompletion.run(); } break; } } } }
void removeMessage(MessageId id) { Message removed; synchronized (this) { removed = map.remove(id); if ((lastBatch != null && lastBatch.equals(id)) || map.isEmpty()) { resetBatching(); } } if (removed != null) { removed.decrementReferenceCount(); } }
synchronized void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception { boolean pastLackBatch = lastBatch == null; MessageId lastId = null; // the message table is a synchronizedMap - so just have to synchronize here int count = 0; for (Iterator<Entry<MessageId, Message>> iter = map.entrySet().iterator(); iter.hasNext() && count < maxReturned;) { Entry<MessageId, Message> entry = iter.next(); if (pastLackBatch) { count++; Message msg = entry.getValue(); lastId = entry.getKey(); listener.recoverMessage(msg); } else { pastLackBatch = entry.getKey().equals(lastBatch); } } if (lastId != null) { lastBatch = lastId; } }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || o.getClass() != getClass()) { return false; } ActiveMQMessage msg = (ActiveMQMessage) o; MessageId oMsg = msg.getMessageId(); MessageId thisMsg = this.getMessageId(); return thisMsg != null && oMsg != null && oMsg.equals(thisMsg); }
@Override public void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception { synchronized (messageTable) { boolean pastLackBatch = lastBatchId == null; for (Map.Entry<MessageId, Message> entry : messageTable.entrySet()) { if (pastLackBatch) { Object msg = entry.getValue(); lastBatchId = entry.getKey(); if (msg.getClass() == MessageId.class) { listener.recoverMessageReference((MessageId) msg); } else { listener.recoverMessage((Message) msg); } } else { pastLackBatch = entry.getKey().equals(lastBatchId); } } } }
public void removeMessage(MessageId msgId) throws IOException { synchronized (messageTable) { Message removed = messageTable.remove(msgId); if (removed != null) { removed.decrementReferenceCount(); decMessageStoreStatistics(getMessageStoreStatistics(), removed); } if ((lastBatchId != null && lastBatchId.equals(msgId)) || messageTable.isEmpty()) { lastBatchId = null; } } }
private void removeFromDeliveredMessages(MessageId key) { Iterator<MessageDispatch> iterator = deliveredMessages.iterator(); while (iterator.hasNext()) { MessageDispatch candidate = iterator.next(); if (key.equals(candidate.getMessage().getMessageId())) { session.connection.rollbackDuplicate(this, candidate.getMessage()); iterator.remove(); break; } } }
qmr.decrementReferenceCount(); messages.rollback(qmr.getMessageId()); if (msgId.equals(qmr.getMessageId())) { return qmr;
try { for (MessageReference ref : dispatchPendingList) { if (messageId.equals(ref.getMessageId())) { message = (QueueMessageReference)ref; dispatchPendingList.remove(ref); MessageReference node = messages.next(); messages.remove(); if (messageId.equals(node.getMessageId())) { message = this.createMessageReference(node.getMessage()); break;
MessageId messageId = node.getMessageId(); if (ack.getFirstMessageId() == null || ack.getFirstMessageId().equals(messageId)) { inAckRange = true; if (ack.getLastMessageId().equals(messageId)) { destination = (Destination) node.getRegionDestination(); callDispatchMatched = true; if (ack.getLastMessageId().equals(messageId)) { final MessageReference node = iter.next(); Destination nodeDest = (Destination) node.getRegionDestination(); if (ack.getLastMessageId().equals(node.getMessageId())) { expandPrefetchExtension(ack.getMessageCount()); destination = nodeDest; Destination nodeDest = (Destination) node.getRegionDestination(); MessageId messageId = node.getMessageId(); if (ack.getFirstMessageId() == null || ack.getFirstMessageId().equals(messageId)) { inAckRange = true; if (ack.getLastMessageId().equals(messageId)) { contractPrefetchExtension(1); destination = (Destination) node.getRegionDestination(); MessageId messageId = node.getMessageId(); if (ack.getFirstMessageId() == null || ack.getFirstMessageId().equals(messageId)) {
@Override public void processMessageDispatchNotification(MessageDispatchNotification mdn) { synchronized (matchedListMutex) { try { matched.reset(); while (matched.hasNext()) { MessageReference node = matched.next(); node.decrementReferenceCount(); if (node.getMessageId().equals(mdn.getMessageId())) { synchronized(dispatchLock) { matched.remove(); getSubscriptionStatistics().getDispatched().increment(); if (isUseTopicSubscriptionInflightStats()) { dispatched.add(new DispatchedNode(node)); getSubscriptionStatistics().getInflightMessageSize().addSize(node.getSize()); } node.decrementReferenceCount(); } break; } } } finally { matched.release(); } } }
@Override public void processMessageDispatchNotification(MessageDispatchNotification mdn) throws Exception { synchronized(pendingLock) { try { pending.reset(); while (pending.hasNext()) { MessageReference node = pending.next(); node.decrementReferenceCount(); if (node.getMessageId().equals(mdn.getMessageId())) { // Synchronize between dispatched list and removal of messages from pending list // related to remove subscription action synchronized(dispatchLock) { pending.remove(); createMessageDispatch(node, node.getMessage()); dispatched.add(node); getSubscriptionStatistics().getInflightMessageSize().addSize(node.getSize()); onDispatch(node, node.getMessage()); } return; } } } finally { pending.release(); } } throw new JMSException( "Slave broker out of sync with master: Dispatched message (" + mdn.getMessageId() + ") was not in the pending list for " + mdn.getConsumerId() + " on " + mdn.getDestination().getPhysicalName()); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } return obj instanceof AsyncJobKey && id.equals(((AsyncJobKey) obj).id) && destination.equals(((AsyncJobKey) obj).destination); }
public void removeMessage(MessageId msgId) throws IOException { synchronized (messageTable) { Message removed = messageTable.remove(msgId); if( removed !=null ) { removed.decrementReferenceCount(); } if ((lastBatchId != null && lastBatchId.equals(msgId)) || messageTable.isEmpty()) { lastBatchId = null; } } }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || o.getClass() != getClass()) { return false; } ActiveMQMessage msg = (ActiveMQMessage) o; MessageId oMsg = msg.getMessageId(); MessageId thisMsg = this.getMessageId(); return thisMsg != null && oMsg != null && oMsg.equals(thisMsg); }
private void removeFromDeliveredMessages(MessageId key) { Iterator<MessageDispatch> iterator = deliveredMessages.iterator(); while (iterator.hasNext()) { MessageDispatch candidate = iterator.next(); if (key.equals(candidate.getMessage().getMessageId())) { session.connection.rollbackDuplicate(this, candidate.getMessage()); iterator.remove(); break; } } }
public void removeMessage(MessageId msgId) throws IOException { synchronized (messageTable) { Message removed = messageTable.remove(msgId); if (removed != null) { removed.decrementReferenceCount(); decMessageStoreStatistics(getMessageStoreStatistics(), removed); } if ((lastBatchId != null && lastBatchId.equals(msgId)) || messageTable.isEmpty()) { lastBatchId = null; } } }