Tabnine Logo
Destination.getConsumers
Code IndexAdd Tabnine to your IDE (free)

How to use
getConsumers
method
in
org.apache.activemq.broker.region.Destination

Best Java code snippets using org.apache.activemq.broker.region.Destination.getConsumers (Showing top 20 results out of 315)

origin: apache/activemq

@Override
public List<Subscription> getConsumers() {
  return next.getConsumers();
}
origin: apache/activemq

List<Subscription> subscribers = destination.getConsumers();
origin: apache/activemq

@Override
public synchronized void removeAll(){
  cache.clear();
  if (destination != null) {
    for (Subscription s : destination.getConsumers()) {
      s.getConsumerInfo().clearAssignedGroupCount(destination.getActiveMQDestination());
    }
  }
}
origin: apache/activemq

@Override
public ObjectName[] getSubscriptions() throws IOException, MalformedObjectNameException {
  List<Subscription> subscriptions = destination.getConsumers();
  ObjectName[] answer = new ObjectName[subscriptions.size()];
  ObjectName brokerObjectName = broker.getBrokerService().getBrokerObjectName();
  int index = 0;
  for (Subscription subscription : subscriptions) {
    String connectionClientId = subscription.getContext().getClientId();
    answer[index++] = BrokerMBeanSupport.createSubscriptionName(brokerObjectName, connectionClientId, subscription.getConsumerInfo());
  }
  return answer;
}
origin: apache/activemq

  @Override
  public boolean removeEldestEntry(final Map.Entry eldest) {
    boolean remove = super.removeEldestEntry(eldest);
    if (remove) {
      if (destination != null) {
        for (Subscription s : destination.getConsumers()) {
         if (s.getConsumerInfo().getConsumerId().equals(eldest.getValue())) {
           s.getConsumerInfo().decrementAssignedGroupCount(destination.getActiveMQDestination());
           break;
          }
        }
      }
    }
    return remove;
  }
};
origin: gocd/gocd

public void removeQueue(String queueName) {
  try {
    ActiveMQQueue destination = new ActiveMQQueue(queueName);
    ConnectionContext connectionContext = BrokerSupport.getConnectionContext(broker.getBroker());
    Destination brokerDestination = broker.getDestination(destination);
    List<Subscription> consumers = brokerDestination.getConsumers();
    for (Subscription consumer : consumers) {
      consumer.remove(connectionContext, brokerDestination);
      brokerDestination.removeSubscription(connectionContext, consumer, 0);
    }
    broker.getBroker().removeDestination(connectionContext, destination, 1000);
    broker.removeDestination(destination);
  } catch (Exception e) {
    throw bomb(e);
  }
}
origin: apache/activemq

/**
 * Respect the selectors of the subscriptions to ensure only matched messages are dispatched to
 * the virtual queues, hence there is no build up of unmatched messages on these destinations
 */
@Override
protected boolean shouldDispatch(final Broker broker, Message message, Destination dest) throws IOException {
  //first validate that the prefix matches in the super class
  if (super.shouldDispatch(broker, message, dest)) {
    boolean matches = false;
    MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext();
    msgContext.setDestination(dest.getActiveMQDestination());
    msgContext.setMessageReference(message);
    List<Subscription> subs = dest.getConsumers();
    for (Subscription sub : subs) {
      if (sub.matches(message, msgContext)) {
        matches = true;
        break;
      }
    }
    if (matches == false) {
      matches = tryMatchingCachedSubs(broker, dest, msgContext);
    }
    return matches;
  }
  return false;
}
origin: apache/activemq

private boolean hasNoLocalConsumers(final Message message, final MessageEvaluationContext mec) {
  Destination regionDestination = (Destination) mec.getMessageReference().getRegionDestination();
  List<Subscription> consumers = regionDestination.getConsumers();
  for (Subscription sub : consumers) {
    if (!sub.getConsumerInfo().isNetworkSubscription() && !sub.getConsumerInfo().isBrowser()) {
      if (!isSelectorAware()) {
        LOG.trace("Not replaying [{}] for [{}] to origin due to existing local consumer: {}", new Object[]{
            message.getMessageId(), message.getDestination(), sub.getConsumerInfo()
        });
        return false;
      } else {
        try {
          if (sub.matches(message, mec)) {
            LOG.trace("Not replaying [{}] for [{}] to origin due to existing selector matching local consumer: {}", new Object[]{
                message.getMessageId(), message.getDestination(), sub.getConsumerInfo()
            });
            return false;
          }
        } catch (Exception ignored) {}
      }
    }
  }
  return true;
}
origin: org.apache.activemq/activemq-broker

@Override
public List<Subscription> getConsumers() {
  return next.getConsumers();
}
origin: org.apache.activemq/activemq-all

@Override
public List<Subscription> getConsumers() {
  return next.getConsumers();
}
origin: org.apache.activemq/activemq-osgi

@Override
public List<Subscription> getConsumers() {
  return next.getConsumers();
}
origin: pierre/meteo

public ObjectName[] getSubscriptions() throws IOException, MalformedObjectNameException {
  List<Subscription> subscriptions = destination.getConsumers();
  ObjectName[] answer = new ObjectName[subscriptions.size()];
  ObjectName objectName = broker.getBrokerService().getBrokerObjectName();
  int index = 0;
  for (Subscription subscription : subscriptions) {
    String connectionClientId = subscription.getContext().getClientId();
    String objectNameStr = ManagedRegionBroker.getSubscriptionObjectName(subscription, connectionClientId, objectName);
    answer[index++] = new ObjectName(objectNameStr);
  }
  return answer;
}
origin: org.apache.activemq/activemq-broker

@Override
public synchronized void removeAll(){
  cache.clear();
  if (destination != null) {
    for (Subscription s : destination.getConsumers()) {
      s.getConsumerInfo().clearAssignedGroupCount(destination.getActiveMQDestination());
    }
  }
}
origin: org.apache.activemq/activemq-all

@Override
public synchronized void removeAll(){
  cache.clear();
  if (destination != null) {
    for (Subscription s : destination.getConsumers()) {
      s.getConsumerInfo().clearAssignedGroupCount(destination.getActiveMQDestination());
    }
  }
}
origin: org.apache.activemq/activemq-osgi

@Override
public synchronized void removeAll(){
  cache.clear();
  if (destination != null) {
    for (Subscription s : destination.getConsumers()) {
      s.getConsumerInfo().clearAssignedGroupCount(destination.getActiveMQDestination());
    }
  }
}
origin: org.apache.activemq/activemq-broker

@Override
public ObjectName[] getSubscriptions() throws IOException, MalformedObjectNameException {
  List<Subscription> subscriptions = destination.getConsumers();
  ObjectName[] answer = new ObjectName[subscriptions.size()];
  ObjectName brokerObjectName = broker.getBrokerService().getBrokerObjectName();
  int index = 0;
  for (Subscription subscription : subscriptions) {
    String connectionClientId = subscription.getContext().getClientId();
    answer[index++] = BrokerMBeanSupport.createSubscriptionName(brokerObjectName, connectionClientId, subscription.getConsumerInfo());
  }
  return answer;
}
origin: org.apache.activemq/activemq-all

@Override
public ObjectName[] getSubscriptions() throws IOException, MalformedObjectNameException {
  List<Subscription> subscriptions = destination.getConsumers();
  ObjectName[] answer = new ObjectName[subscriptions.size()];
  ObjectName brokerObjectName = broker.getBrokerService().getBrokerObjectName();
  int index = 0;
  for (Subscription subscription : subscriptions) {
    String connectionClientId = subscription.getContext().getClientId();
    answer[index++] = BrokerMBeanSupport.createSubscriptionName(brokerObjectName, connectionClientId, subscription.getConsumerInfo());
  }
  return answer;
}
origin: org.apache.activemq/activemq-osgi

@Override
public ObjectName[] getSubscriptions() throws IOException, MalformedObjectNameException {
  List<Subscription> subscriptions = destination.getConsumers();
  ObjectName[] answer = new ObjectName[subscriptions.size()];
  ObjectName brokerObjectName = broker.getBrokerService().getBrokerObjectName();
  int index = 0;
  for (Subscription subscription : subscriptions) {
    String connectionClientId = subscription.getContext().getClientId();
    answer[index++] = BrokerMBeanSupport.createSubscriptionName(brokerObjectName, connectionClientId, subscription.getConsumerInfo());
  }
  return answer;
}
origin: org.apache.activemq/activemq-all

private boolean hasNoLocalConsumers(final Message message, final MessageEvaluationContext mec) {
  Destination regionDestination = (Destination) mec.getMessageReference().getRegionDestination();
  List<Subscription> consumers = regionDestination.getConsumers();
  for (Subscription sub : consumers) {
    if (!sub.getConsumerInfo().isNetworkSubscription() && !sub.getConsumerInfo().isBrowser()) {
      LOG.trace("Not replaying [{}] for [{}] to origin due to existing local consumer: {}", new Object[]{
          message.getMessageId(), message.getDestination(), sub.getConsumerInfo()
      });
      return false;
    }
  }
  return true;
}
origin: org.apache.activemq/activemq-broker

private boolean hasNoLocalConsumers(final Message message, final MessageEvaluationContext mec) {
  Destination regionDestination = (Destination) mec.getMessageReference().getRegionDestination();
  List<Subscription> consumers = regionDestination.getConsumers();
  for (Subscription sub : consumers) {
    if (!sub.getConsumerInfo().isNetworkSubscription() && !sub.getConsumerInfo().isBrowser()) {
      LOG.trace("Not replaying [{}] for [{}] to origin due to existing local consumer: {}", new Object[]{
          message.getMessageId(), message.getDestination(), sub.getConsumerInfo()
      });
      return false;
    }
  }
  return true;
}
org.apache.activemq.broker.regionDestinationgetConsumers

Popular methods of Destination

  • getDestinationStatistics
  • getName
  • getActiveMQDestination
  • browse
  • removeSubscription
  • acknowledge
  • addProducer
  • addSubscription
  • dispose
  • fastProducer
    Called to notify a producer is too fast
  • gc
  • getBlockedProducerWarningInterval
  • gc,
  • getBlockedProducerWarningInterval,
  • getCursorMemoryHighWaterMark,
  • getDeadLetterStrategy,
  • getMaxAuditDepth,
  • getMaxBrowsePageSize,
  • getMaxPageSize,
  • getMaxProducersToAudit,
  • getMemoryUsage

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now