@Override public void onUsageChanged(Usage usage, int oldPercentUsage, int newPercentUsage) { if (oldPercentUsage > newPercentUsage && oldPercentUsage >= 90) { try { dispatchPending(); } catch (IOException e) { LOG.warn("problem calling dispatchMatched", e); } } }
private void clearPendingAndDispatch(DurableTopicSubscription durableTopicSubscription) { synchronized (durableTopicSubscription.pendingLock) { durableTopicSubscription.pending.clear(); try { durableTopicSubscription.dispatchPending(); } catch (IOException exception) { LOG.warn("After clear of pending, failed to dispatch to: {}, for: {}, pending: {}", new Object[]{ durableTopicSubscription, destination, durableTopicSubscription.pending }, exception); } } }
dispatchPending(); this.usageManager.getMemoryUsage().addUsageListener(this);
@Override public void add(ConnectionContext context, Destination destination) throws Exception { if (!destinations.contains(destination)) { super.add(context, destination); } // do it just once per destination if (durableDestinations.containsKey(destination.getActiveMQDestination())) { return; } durableDestinations.put(destination.getActiveMQDestination(), destination); if (active.get() || keepDurableSubsActive) { Topic topic = (Topic) destination; topic.activate(context, this); getSubscriptionStatistics().getEnqueues().add(pending.size()); } else if (destination.getMessageStore() != null) { TopicMessageStore store = (TopicMessageStore) destination.getMessageStore(); try { getSubscriptionStatistics().getEnqueues().add(store.getMessageCount(subscriptionKey.getClientId(), subscriptionKey.getSubscriptionName())); } catch (IOException e) { JMSException jmsEx = new JMSException("Failed to retrieve enqueueCount from store " + e); jmsEx.setLinkedException(e); throw jmsEx; } } dispatchPending(); }
@Override public void onUsageChanged(Usage usage, int oldPercentUsage, int newPercentUsage) { if (oldPercentUsage > newPercentUsage && oldPercentUsage >= 90) { try { dispatchPending(); } catch (IOException e) { LOG.warn("problem calling dispatchMatched", e); } } }
public void onUsageChanged(Usage usage, int oldPercentUsage, int newPercentUsage) { if (oldPercentUsage > newPercentUsage && oldPercentUsage >= 90) { try { dispatchPending(); } catch (IOException e) { LOG.warn("problem calling dispatchMatched", e); } } }
@Override public void onUsageChanged(Usage usage, int oldPercentUsage, int newPercentUsage) { if (oldPercentUsage > newPercentUsage && oldPercentUsage >= 90) { try { dispatchPending(); } catch (IOException e) { LOG.warn("problem calling dispatchMatched", e); } } }
@Override public void onUsageChanged(Usage usage, int oldPercentUsage, int newPercentUsage) { if (oldPercentUsage > newPercentUsage && oldPercentUsage >= 90) { try { dispatchPending(); } catch (IOException e) { LOG.warn("problem calling dispatchMatched", e); } } }
private void clearPendingAndDispatch(DurableTopicSubscription durableTopicSubscription) { synchronized (durableTopicSubscription.pendingLock) { durableTopicSubscription.pending.clear(); try { durableTopicSubscription.dispatchPending(); } catch (IOException exception) { LOG.warn("After clear of pending, failed to dispatch to: {}, for: {}, pending: {}", new Object[]{ durableTopicSubscription, destination, durableTopicSubscription.pending }, exception); } } }
private void clearPendingAndDispatch(DurableTopicSubscription durableTopicSubscription) { synchronized (durableTopicSubscription.pendingLock) { durableTopicSubscription.pending.clear(); try { durableTopicSubscription.dispatchPending(); } catch (IOException exception) { LOG.warn("After clear of pending, failed to dispatch to: {}, for: {}, pending: {}", new Object[]{ durableTopicSubscription, destination, durableTopicSubscription.pending }, exception); } } }
private void clearPendingAndDispatch(DurableTopicSubscription durableTopicSubscription) { synchronized (durableTopicSubscription.pendingLock) { durableTopicSubscription.pending.clear(); try { durableTopicSubscription.dispatchPending(); } catch (IOException exception) { LOG.warn("After clear of pending, failed to dispatch to: {}, for: {}, pending: {}", new Object[]{ durableTopicSubscription, destination, durableTopicSubscription.pending }, exception); } } }
dispatchPending(); this.usageManager.getMemoryUsage().addUsageListener(this);
public void add(ConnectionContext context, Destination destination) throws Exception { super.add(context, destination); // do it just once per destination if (destinations.containsKey(destination.getActiveMQDestination())) { return; } destinations.put(destination.getActiveMQDestination(), destination); if (active.get() || keepDurableSubsActive) { Topic topic = (Topic)destination; topic.activate(context, this); if (pending.isEmpty(topic)) { topic.recoverRetroactiveMessages(context, this); } this.enqueueCounter+=pending.size(); } else if (destination.getMessageStore() != null) { TopicMessageStore store = (TopicMessageStore)destination.getMessageStore(); try { this.enqueueCounter+=store.getMessageCount(subscriptionKey.getClientId(),subscriptionKey.getSubscriptionName()); } catch (IOException e) { JMSException jmsEx = new JMSException("Failed to retrieve eunqueueCount from store "+ e); jmsEx.setLinkedException(e); throw jmsEx; } } dispatchPending(); }
dispatchPending(); this.usageManager.getMemoryUsage().addUsageListener(this);
dispatchPending(); this.usageManager.getMemoryUsage().addUsageListener(this);
dispatchPending(); this.usageManager.getMemoryUsage().addUsageListener(this);
@Override public void add(ConnectionContext context, Destination destination) throws Exception { if (!destinations.contains(destination)) { super.add(context, destination); } // do it just once per destination if (durableDestinations.containsKey(destination.getActiveMQDestination())) { return; } durableDestinations.put(destination.getActiveMQDestination(), destination); if (active.get() || keepDurableSubsActive) { Topic topic = (Topic) destination; topic.activate(context, this); getSubscriptionStatistics().getEnqueues().add(pending.size()); } else if (destination.getMessageStore() != null) { TopicMessageStore store = (TopicMessageStore) destination.getMessageStore(); try { getSubscriptionStatistics().getEnqueues().add(store.getMessageCount(subscriptionKey.getClientId(), subscriptionKey.getSubscriptionName())); } catch (IOException e) { JMSException jmsEx = new JMSException("Failed to retrieve enqueueCount from store " + e); jmsEx.setLinkedException(e); throw jmsEx; } } dispatchPending(); }
@Override public void add(ConnectionContext context, Destination destination) throws Exception { if (!destinations.contains(destination)) { super.add(context, destination); } // do it just once per destination if (durableDestinations.containsKey(destination.getActiveMQDestination())) { return; } durableDestinations.put(destination.getActiveMQDestination(), destination); if (active.get() || keepDurableSubsActive) { Topic topic = (Topic) destination; topic.activate(context, this); getSubscriptionStatistics().getEnqueues().add(pending.size()); } else if (destination.getMessageStore() != null) { TopicMessageStore store = (TopicMessageStore) destination.getMessageStore(); try { getSubscriptionStatistics().getEnqueues().add(store.getMessageCount(subscriptionKey.getClientId(), subscriptionKey.getSubscriptionName())); } catch (IOException e) { JMSException jmsEx = new JMSException("Failed to retrieve enqueueCount from store " + e); jmsEx.setLinkedException(e); throw jmsEx; } } dispatchPending(); }
@Override public void add(ConnectionContext context, Destination destination) throws Exception { if (!destinations.contains(destination)) { super.add(context, destination); } // do it just once per destination if (durableDestinations.containsKey(destination.getActiveMQDestination())) { return; } durableDestinations.put(destination.getActiveMQDestination(), destination); if (active.get() || keepDurableSubsActive) { Topic topic = (Topic) destination; topic.activate(context, this); getSubscriptionStatistics().getEnqueues().add(pending.size()); } else if (destination.getMessageStore() != null) { TopicMessageStore store = (TopicMessageStore) destination.getMessageStore(); try { getSubscriptionStatistics().getEnqueues().add(store.getMessageCount(subscriptionKey.getClientId(), subscriptionKey.getSubscriptionName())); } catch (IOException e) { JMSException jmsEx = new JMSException("Failed to retrieve enqueueCount from store " + e); jmsEx.setLinkedException(e); throw jmsEx; } } dispatchPending(); }