@Override public void setPrefetchSize(int prefetchSize) { this.info.setPrefetchSize(prefetchSize); try { this.dispatchPending(); } catch (Exception e) { LOG.trace("Caught exception during dispatch after prefetch change.", e); } } }
@Override public void dispatchPending() throws IOException { if (isActive()) { super.dispatchPending(); } }
/** * Occurs when a pull times out. If nothing has been dispatched since the * timeout was setup, then send the NULL message. */ final void pullTimeout(long dispatchCounterBeforePull, boolean alwaysSignalDone) { synchronized (pendingLock) { if (dispatchCounterBeforePull == getSubscriptionStatistics().getDispatched().getCount() || alwaysSignalDone) { try { prefetchExtension.set(1); add(QueueMessageReference.NULL_MESSAGE); dispatchPending(); } catch (Exception e) { context.getConnection().serviceException(e); } finally { prefetchExtension.set(0); } } } }
@Override public void add(MessageReference node) throws Exception { synchronized (pendingLock) { // The destination may have just been removed... if (!destinations.contains(node.getRegionDestination()) && node != QueueMessageReference.NULL_MESSAGE) { // perhaps we should inform the caller that we are no longer valid to dispatch to? return; } // Don't increment for the pullTimeout control message. if (!node.equals(QueueMessageReference.NULL_MESSAGE)) { getSubscriptionStatistics().getEnqueues().increment(); } pending.addMessageLast(node); } dispatchPending(); }
dest.iterate(); dispatchPending(); dispatchPending();
protected void onDispatch(final MessageReference node, final Message message) { Destination nodeDest = (Destination) node.getRegionDestination(); if (nodeDest != null) { if (node != QueueMessageReference.NULL_MESSAGE) { nodeDest.getDestinationStatistics().getDispatched().increment(); nodeDest.getDestinationStatistics().getInflight().increment(); LOG.trace("{} dispatched: {} - {}, dispatched: {}, inflight: {}", new Object[]{ info.getConsumerId(), message.getMessageId(), message.getDestination(), getSubscriptionStatistics().getDispatched().getCount(), dispatched.size() }); } } if (info.isDispatchAsync()) { try { dispatchPending(); } catch (IOException e) { context.getConnection().serviceExceptionAsync(e); } } }
@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 setPrefetchSize(int prefetchSize) { this.info.setPrefetchSize(prefetchSize); try { this.dispatchPending(); } catch (Exception e) { LOG.trace("Caught exception during dispatch after prefetch change.", e); } } }
@Override public void dispatchPending() throws IOException { if (isActive()) { super.dispatchPending(); } }
@Override public void setPrefetchSize(int prefetchSize) { this.info.setPrefetchSize(prefetchSize); try { this.dispatchPending(); } catch (Exception e) { LOG.trace("Caught exception during dispatch after prefetch change.", e); } } }
@Override public void dispatchPending() throws IOException { if (isActive()) { super.dispatchPending(); } }
@Override public void dispatchPending() throws IOException { if (isActive()) { super.dispatchPending(); } }
@Override public void setPrefetchSize(int prefetchSize) { this.info.setPrefetchSize(prefetchSize); try { this.dispatchPending(); } catch (Exception e) { LOG.trace("Caught exception during dispatch after prefetch change.", e); } } }
protected void dispatchPending() throws IOException { if (isActive()) { super.dispatchPending(); } }
public void add(MessageReference node) throws Exception { synchronized (pendingLock) { // The destination may have just been removed... if( !destinations.contains(node.getRegionDestination()) && node!=QueueMessageReference.NULL_MESSAGE) { // perhaps we should inform the caller that we are no longer valid to dispatch to? return; } enqueueCounter++; pending.addMessageLast(node); } dispatchPending(); }
@Override public void add(MessageReference node) throws Exception { synchronized (pendingLock) { // The destination may have just been removed... if (!destinations.contains(node.getRegionDestination()) && node != QueueMessageReference.NULL_MESSAGE) { // perhaps we should inform the caller that we are no longer valid to dispatch to? return; } // Don't increment for the pullTimeout control message. if (!node.equals(QueueMessageReference.NULL_MESSAGE)) { getSubscriptionStatistics().getEnqueues().increment(); } pending.addMessageLast(node); } dispatchPending(); }
@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(); }
@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(); }
@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(); }