public void addToMap(MessageReference message, PendingNode node) { PendingNode previous = this.map.put(message.getMessageId(), node); if (previous != null) { try { messageSize.addSize(-previous.getMessage().getSize()); } catch (Exception e) { //expected for NullMessageReference } } try { messageSize.addSize(message.getSize()); } catch (Exception e) { //expected for NullMessageReference } }
public PendingNode removeFromMap(MessageReference message) { PendingNode removed = this.map.remove(message.getMessageId()); if (removed != null) { try { messageSize.addSize(-removed.getMessage().getSize()); } catch (Exception e) { //expected for NullMessageReference } } return removed; } }
private void addReferencesAndUpdateRedispatch(LinkedList<MessageReference> redispatch, Destination destination, List<MessageReference> dispatched) { ArrayList<MessageReference> references = new ArrayList<MessageReference>(); for (MessageReference r : dispatched) { if (r.getRegionDestination() == destination) { references.add(r); getSubscriptionStatistics().getInflightMessageSize().addSize(-r.getSize()); } } redispatch.addAll(0, references); destination.getDestinationStatistics().getInflight().subtract(references.size()); dispatched.removeAll(references); }
public DispatchedNode(final MessageReference node) { super(); this.size = node.getSize(); this.messageId = node.getMessageId(); this.destination = node.getRegionDestination() instanceof Destination ? ((Destination)node.getRegionDestination()) : null; }
getSubscriptionStatistics().getDispatched().increment(); dispatched.add(node); getSubscriptionStatistics().getInflightMessageSize().addSize(node.getSize());
@Override public void afterCommit() throws Exception { Destination nodeDest = (Destination) node.getRegionDestination(); synchronized (dispatchLock) { getSubscriptionStatistics().getDequeues().increment(); if (dispatched.remove(node)) { // if consumer is removed, dispatched will be empty and inflight will // already have been adjusted getSubscriptionStatistics().getInflightMessageSize().addSize(-node.getSize()); nodeDest.getDestinationStatistics().getInflight().decrement(); } } contractPrefetchExtension(1); nodeDest.wakeup(); dispatchPending(); }
@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()); }
getSubscriptionStatistics().getInflightMessageSize().addSize(-node.getSize()); ((Destination)node.getRegionDestination()).getDestinationStatistics().getInflight().decrement(); dispatched.remove(node); getSubscriptionStatistics().getInflightMessageSize().addSize(-node.getSize()); contractPrefetchExtension(1); } else { getSubscriptionStatistics().getInflightMessageSize().addSize(-node.getSize());
if (isUseTopicSubscriptionInflightStats()) { dispatched.add(new DispatchedNode(node)); getSubscriptionStatistics().getInflightMessageSize().addSize(node.getSize());
public PendingNode removeFromMap(MessageReference message) { PendingNode removed = this.map.remove(message.getMessageId()); if (removed != null) { try { messageSize.addSize(-removed.getMessage().getSize()); } catch (Exception e) { //expected for NullMessageReference } } return removed; } }
public PendingNode removeFromMap(MessageReference message) { PendingNode removed = this.map.remove(message.getMessageId()); if (removed != null) { try { messageSize.addSize(-removed.getMessage().getSize()); } catch (Exception e) { //expected for NullMessageReference } } return removed; } }
public PendingNode removeFromMap(MessageReference message) { PendingNode removed = this.map.remove(message.getMessageId()); if (removed != null) { try { messageSize.addSize(-removed.getMessage().getSize()); } catch (Exception e) { //expected for NullMessageReference } } return removed; } }
private void addReferencesAndUpdateRedispatch(LinkedList<MessageReference> redispatch, Destination destination, List<MessageReference> dispatched) { ArrayList<MessageReference> references = new ArrayList<MessageReference>(); for (MessageReference r : dispatched) { if (r.getRegionDestination() == destination) { references.add(r); getSubscriptionStatistics().getInflightMessageSize().addSize(-r.getSize()); } } redispatch.addAll(0, references); destination.getDestinationStatistics().getInflight().subtract(references.size()); dispatched.removeAll(references); }
private void addReferencesAndUpdateRedispatch(LinkedList<MessageReference> redispatch, Destination destination, List<MessageReference> dispatched) { ArrayList<MessageReference> references = new ArrayList<MessageReference>(); for (MessageReference r : dispatched) { if (r.getRegionDestination() == destination) { references.add(r); getSubscriptionStatistics().getInflightMessageSize().addSize(-r.getSize()); } } redispatch.addAll(0, references); destination.getDestinationStatistics().getInflight().subtract(references.size()); dispatched.removeAll(references); }
private void addReferencesAndUpdateRedispatch(LinkedList<MessageReference> redispatch, Destination destination, List<MessageReference> dispatched) { ArrayList<MessageReference> references = new ArrayList<MessageReference>(); for (MessageReference r : dispatched) { if (r.getRegionDestination() == destination) { references.add(r); getSubscriptionStatistics().getInflightMessageSize().addSize(-r.getSize()); } } redispatch.addAll(0, references); destination.getDestinationStatistics().getInflight().subtract(references.size()); dispatched.removeAll(references); }
public DispatchedNode(final MessageReference node) { super(); this.size = node.getSize(); this.messageId = node.getMessageId(); this.destination = node.getRegionDestination() instanceof Destination ? ((Destination)node.getRegionDestination()) : null; }
public DispatchedNode(final MessageReference node) { super(); this.size = node.getSize(); this.messageId = node.getMessageId(); this.destination = node.getRegionDestination() instanceof Destination ? ((Destination)node.getRegionDestination()) : null; }
public DispatchedNode(final MessageReference node) { super(); this.size = node.getSize(); this.messageId = node.getMessageId(); this.destination = node.getRegionDestination() instanceof Destination ? ((Destination)node.getRegionDestination()) : null; }
@Override public void afterCommit() throws Exception { Destination nodeDest = (Destination) node.getRegionDestination(); synchronized (dispatchLock) { getSubscriptionStatistics().getDequeues().increment(); dispatched.remove(node); getSubscriptionStatistics().getInflightMessageSize().addSize(-node.getSize()); nodeDest.getDestinationStatistics().getInflight().decrement(); } contractPrefetchExtension(1); nodeDest.wakeup(); dispatchPending(); }