public void deleteSubscription(ConnectionContext context, SubscriptionKey key) throws Exception { if (next instanceof DestinationFilter) { DestinationFilter filter = (DestinationFilter) next; filter.deleteSubscription(context, key); } else if (next instanceof Topic) { Topic topic = (Topic)next; topic.deleteSubscription(context, key); } }
@Override public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { // do dispatch Subscription sub = getMatchingSubscription(messageDispatchNotification); if (sub != null) { MessageReference message = getMatchingMessage(messageDispatchNotification); sub.add(message); sub.processMessageDispatchNotification(messageDispatchNotification); } }
@Override public void onSuccess() { Destination regionDestination = (Destination) node.getRegionDestination(); regionDestination.getDestinationStatistics().getDispatched().increment(); regionDestination.getDestinationStatistics().getInflight().increment(); node.decrementReferenceCount(); }
/** * store will have a pending ack for all durables, irrespective of the * selector so we need to ack if node is un-matched */ @Override public void unmatched(MessageReference node) throws IOException { MessageAck ack = new MessageAck(); ack.setAckType(MessageAck.UNMATCHED_ACK_TYPE); ack.setMessageID(node.getMessageId()); Destination regionDestination = (Destination) node.getRegionDestination(); regionDestination.acknowledge(this.getContext(), this, ack, node); }
protected void dispose(ConnectionContext context, Destination dest) throws Exception { dest.dispose(context); dest.stop(); destinationFactory.removeDestination(dest); }
@Override public void resetStatistics() { destination.getDestinationStatistics().reset(); }
@Override public void dispatchPending() throws IOException { if (isActive()) { super.dispatchPending(); } }
/** * Removes the messages matching the given selector up to the maximum number * of matched messages * * @return the number of messages removed */ public int removeMatchingMessages(String selector, int maximumMessages) throws Exception { return removeMatchingMessages(createSelectorFilter(selector), maximumMessages); }
@Override public void resetStatistics() { if (subscription != null && subscription.getSubscriptionStatistics() != null){ subscription.getSubscriptionStatistics().reset(); } }
private boolean hasDurableSubChanged(SubscriptionInfo info1, ConsumerInfo info2) throws IOException { if (hasSelectorChanged(info1, info2)) { return true; } return hasNoLocalChanged(info1, info2); }
public void remove(Destination destination) { for (int i = 0; i < interceptors.length; i++) { interceptors[i].remove(destination); } }
/** * @return number of messages that matched the subscription */ @Override public long getDispatchedCounter() { return subscription != null ? subscription.getDispatchedCounter() : 0; }
@Override public void afterCommit() throws Exception { dropMessage(reference); wakeup(); }
public void wakeupDestinationsForDispatch() { for (Destination dest : destinations) { dest.wakeup(); } }
/** * * @return the interval at which warning about blocked producers will be * triggered. */ @Override public long getBlockedProducerWarningInterval() { return destination.getBlockedProducerWarningInterval(); }
@Override public boolean isPaused() { Queue queue = (Queue) destination; return queue.isDispatchPaused(); } }
@Override public void onFailure() { Destination regionDestination = (Destination) node.getRegionDestination(); regionDestination.getDestinationStatistics().getDispatched().increment(); regionDestination.getDestinationStatistics().getInflight().increment(); node.decrementReferenceCount(); } });