org.apache.activemq.broker.region.Queue.getActiveMQDestination()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(14.2k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中org.apache.activemq.broker.region.Queue.getActiveMQDestination方法的一些代码示例,展示了Queue.getActiveMQDestination的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Queue.getActiveMQDestination方法的具体详情如下:
包路径:org.apache.activemq.broker.region.Queue
类名称:Queue
方法名:getActiveMQDestination

Queue.getActiveMQDestination介绍

暂无

代码示例

代码示例来源:origin: apache/activemq

private void expireMessages() {
  LOG.debug("{} expiring messages ..", getActiveMQDestination().getQualifiedName());
  // just track the insertion count
  List<Message> browsedMessages = new InsertionCountList<Message>();
  doBrowse(browsedMessages, this.getMaxExpirePageSize());
  asyncWakeup();
  LOG.debug("{} expiring messages done.", getActiveMQDestination().getQualifiedName());
}

代码示例来源:origin: apache/activemq

@Override
public boolean recoverMessage(Message message) {
  recoveredAccumulator++;
  if ((recoveredAccumulator % 10000) == 0) {
    LOG.info("cursor for {} has recovered {} messages. {}% complete", new Object[]{ getActiveMQDestination().getQualifiedName(), recoveredAccumulator, new Integer((int) (recoveredAccumulator * 100 / totalMessageCount))});
  }
  // Message could have expired while it was being
  // loaded..
  message.setRegionDestination(Queue.this);
  if (message.isExpired() && broker.isExpired(message)) {
    toExpire.add(message);
    return true;
  }
  if (hasSpace()) {
    messagesLock.writeLock().lock();
    try {
      try {
        messages.addMessageLast(message);
      } catch (Exception e) {
        LOG.error("Failed to add message to cursor", e);
      }
    } finally {
      messagesLock.writeLock().unlock();
    }
    destinationStatistics.getMessages().increment();
    return true;
  }
  return false;
}

代码示例来源:origin: apache/activemq

@Override
  public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException {
    MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext();
    messageEvaluationContext.setMessageReference(r);
    if (messageEvaluationContext.getDestination() == null) {
      messageEvaluationContext.setDestination(getActiveMQDestination());
    }
    return selectorExpression.matches(messageEvaluationContext);
  }
};

代码示例来源:origin: apache/activemq

LOG.warn("{} after purge of {} messages, message count stats report: {}", getActiveMQDestination().getQualifiedName(), originalMessageCount, this.destinationStatistics.getMessages().getCount());

代码示例来源:origin: apache/activemq

@Override
public void addSubscription(ConnectionContext context, Subscription sub) throws Exception {
  LOG.debug("{} add sub: {}, dequeues: {}, dispatched: {}, inflight: {}", new Object[]{ getActiveMQDestination().getQualifiedName(), sub, getDestinationStatistics().getDequeues().getCount(), getDestinationStatistics().getDispatched().getCount(), getDestinationStatistics().getInflight().getCount() });

代码示例来源:origin: apache/activemq

@Override
  public void run() {
    TimeoutMessage timeout;
    try {
      while (true) {
        timeout = flowControlTimeoutMessages.take();
        if (timeout != null) {
          synchronized (messagesWaitingForSpace) {
            if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
              ExceptionResponse response = new ExceptionResponse(
                  new ResourceAllocationException(
                      "Usage Manager Memory Limit Wait Timeout. Stopping producer ("
                          + timeout.message.getProducerId()
                          + ") to prevent flooding "
                          + getActiveMQDestination().getQualifiedName()
                          + "."
                          + " See http://activemq.apache.org/producer-flow-control.html for more info"));
              response.setCorrelationId(timeout.message.getCommandId());
              timeout.context.getConnection().dispatchAsync(response);
            }
          }
        }
      }
    } catch (InterruptedException e) {
      LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
    }
  }
}

代码示例来源:origin: apache/activemq

private void checkUsage(ConnectionContext context,ProducerBrokerExchange producerBrokerExchange, Message message) throws ResourceAllocationException, IOException, InterruptedException {
  if (message.isPersistent()) {
    if (store != null && systemUsage.getStoreUsage().isFull(getStoreUsageHighWaterMark())) {
      final String logMessage = "Persistent store is Full, " + getStoreUsageHighWaterMark() + "% of "
        + systemUsage.getStoreUsage().getLimit() + ". Stopping producer ("
        + message.getProducerId() + ") to prevent flooding "
        + getActiveMQDestination().getQualifiedName() + "."
        + " See http://activemq.apache.org/producer-flow-control.html for more info";
      waitForSpace(context, producerBrokerExchange, systemUsage.getStoreUsage(), getStoreUsageHighWaterMark(), logMessage);
    }
  } else if (messages.getSystemUsage() != null && systemUsage.getTempUsage().isFull()) {
    final String logMessage = "Temp Store is Full ("
        + systemUsage.getTempUsage().getPercentUsage() + "% of " + systemUsage.getTempUsage().getLimit()
        +"). Stopping producer (" + message.getProducerId()
      + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "."
      + " See http://activemq.apache.org/producer-flow-control.html for more info";
    waitForSpace(context, producerBrokerExchange, messages.getSystemUsage().getTempUsage(), logMessage);
  }
}

代码示例来源:origin: apache/activemq

try {
  LOG.debug("{} remove sub: {}, lastDeliveredSeqId: {}, dequeues: {}, dispatched: {}, inflight: {}, groups: {}", new Object[]{
      getActiveMQDestination().getQualifiedName(),
      sub,
      lastDeliveredSequenceId,

代码示例来源:origin: apache/activemq

if (state == null) {
  LOG.warn("Send failed for: {}, missing producer state for: {}", message, producerExchange);
  throw new JMSException("Cannot send message to " + getActiveMQDestination() + " with invalid (null) producer state");
    if (isFlowControlLogRequired()) {
      LOG.warn("Usage Manager Memory Limit ({}) reached on {}, size {}. Producers will be throttled to the rate at which messages are removed from this destination to prevent flooding it. See http://activemq.apache.org/producer-flow-control.html for more info.",
            memoryUsage.getLimit(), getActiveMQDestination().getQualifiedName(), destinationStatistics.getMessages().getCount());
    } else {
      LOG.debug("Usage Manager Memory Limit ({}) reached on {}, size {}. Producers will be throttled to the rate at which messages are removed from this destination to prevent flooding it. See http://activemq.apache.org/producer-flow-control.html for more info.",
          memoryUsage.getLimit(), getActiveMQDestination().getQualifiedName(), destinationStatistics.getMessages().getCount());
          if (resourceAllocationException == null) {
            sendMemAllocationException = resourceAllocationException = new ResourceAllocationException("Usage Manager Memory Limit reached on "
                + getActiveMQDestination().getQualifiedName() + "."
                + " See http://activemq.apache.org/producer-flow-control.html for more info");
        waitForSpace(context, producerExchange, memoryUsage, "Usage Manager Memory Limit reached. Producer ("
            + message.getProducerId() + ") stopped to prevent flooding "
            + getActiveMQDestination().getQualifiedName() + "."
            + " See http://activemq.apache.org/producer-flow-control.html for more info");

代码示例来源:origin: org.apache.activemq/activemq-broker

private void expireMessages() {
  LOG.debug("{} expiring messages ..", getActiveMQDestination().getQualifiedName());
  // just track the insertion count
  List<Message> browsedMessages = new InsertionCountList<Message>();
  doBrowse(browsedMessages, this.getMaxExpirePageSize());
  asyncWakeup();
  LOG.debug("{} expiring messages done.", getActiveMQDestination().getQualifiedName());
}

代码示例来源:origin: org.apache.activemq/activemq-all

private void expireMessages() {
  LOG.debug("{} expiring messages ..", getActiveMQDestination().getQualifiedName());
  // just track the insertion count
  List<Message> browsedMessages = new InsertionCountList<Message>();
  doBrowse(browsedMessages, this.getMaxExpirePageSize());
  asyncWakeup();
  LOG.debug("{} expiring messages done.", getActiveMQDestination().getQualifiedName());
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

private void expireMessages() {
  LOG.debug("{} expiring messages ..", getActiveMQDestination().getQualifiedName());
  // just track the insertion count
  List<Message> browsedMessages = new InsertionCountList<Message>();
  doBrowse(browsedMessages, this.getMaxExpirePageSize());
  asyncWakeup();
  LOG.debug("{} expiring messages done.", getActiveMQDestination().getQualifiedName());
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
  public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException {
    MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext();
    messageEvaluationContext.setMessageReference(r);
    if (messageEvaluationContext.getDestination() == null) {
      messageEvaluationContext.setDestination(getActiveMQDestination());
    }
    return selectorExpression.matches(messageEvaluationContext);
  }
};

代码示例来源:origin: org.apache.activemq/activemq-broker

@Override
  public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException {
    MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext();
    messageEvaluationContext.setMessageReference(r);
    if (messageEvaluationContext.getDestination() == null) {
      messageEvaluationContext.setDestination(getActiveMQDestination());
    }
    return selectorExpression.matches(messageEvaluationContext);
  }
};

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
  public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException {
    MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext();
    messageEvaluationContext.setMessageReference(r);
    if (messageEvaluationContext.getDestination() == null) {
      messageEvaluationContext.setDestination(getActiveMQDestination());
    }
    return selectorExpression.matches(messageEvaluationContext);
  }
};

代码示例来源:origin: pierre/meteo

public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException {
    MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext();
    messageEvaluationContext.setMessageReference(r);
    if (messageEvaluationContext.getDestination() == null) {
      messageEvaluationContext.setDestination(getActiveMQDestination());
    }
    return selectorExpression.matches(messageEvaluationContext);
  }
};

代码示例来源:origin: pierre/meteo

protected ConnectionContext createConnectionContext() {
  ConnectionContext answer = new ConnectionContext(new NonCachedMessageEvaluationContext());
  answer.setBroker(this.broker);
  answer.getMessageEvaluationContext().setDestination(getActiveMQDestination());
  answer.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT);
  return answer;
}

代码示例来源:origin: org.apache.activemq/activemq-broker

private void checkUsage(ConnectionContext context,ProducerBrokerExchange producerBrokerExchange, Message message) throws ResourceAllocationException, IOException, InterruptedException {
  if (message.isPersistent()) {
    if (store != null && systemUsage.getStoreUsage().isFull(getStoreUsageHighWaterMark())) {
      final String logMessage = "Persistent store is Full, " + getStoreUsageHighWaterMark() + "% of "
        + systemUsage.getStoreUsage().getLimit() + ". Stopping producer ("
        + message.getProducerId() + ") to prevent flooding "
        + getActiveMQDestination().getQualifiedName() + "."
        + " See http://activemq.apache.org/producer-flow-control.html for more info";
      waitForSpace(context, producerBrokerExchange, systemUsage.getStoreUsage(), getStoreUsageHighWaterMark(), logMessage);
    }
  } else if (messages.getSystemUsage() != null && systemUsage.getTempUsage().isFull()) {
    final String logMessage = "Temp Store is Full ("
        + systemUsage.getTempUsage().getPercentUsage() + "% of " + systemUsage.getTempUsage().getLimit()
        +"). Stopping producer (" + message.getProducerId()
      + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "."
      + " See http://activemq.apache.org/producer-flow-control.html for more info";
    waitForSpace(context, producerBrokerExchange, messages.getSystemUsage().getTempUsage(), logMessage);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-all

private void checkUsage(ConnectionContext context,ProducerBrokerExchange producerBrokerExchange, Message message) throws ResourceAllocationException, IOException, InterruptedException {
  if (message.isPersistent()) {
    if (store != null && systemUsage.getStoreUsage().isFull(getStoreUsageHighWaterMark())) {
      final String logMessage = "Persistent store is Full, " + getStoreUsageHighWaterMark() + "% of "
        + systemUsage.getStoreUsage().getLimit() + ". Stopping producer ("
        + message.getProducerId() + ") to prevent flooding "
        + getActiveMQDestination().getQualifiedName() + "."
        + " See http://activemq.apache.org/producer-flow-control.html for more info";
      waitForSpace(context, producerBrokerExchange, systemUsage.getStoreUsage(), getStoreUsageHighWaterMark(), logMessage);
    }
  } else if (messages.getSystemUsage() != null && systemUsage.getTempUsage().isFull()) {
    final String logMessage = "Temp Store is Full ("
        + systemUsage.getTempUsage().getPercentUsage() + "% of " + systemUsage.getTempUsage().getLimit()
        +"). Stopping producer (" + message.getProducerId()
      + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "."
      + " See http://activemq.apache.org/producer-flow-control.html for more info";
    waitForSpace(context, producerBrokerExchange, messages.getSystemUsage().getTempUsage(), logMessage);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

private void checkUsage(ConnectionContext context,ProducerBrokerExchange producerBrokerExchange, Message message) throws ResourceAllocationException, IOException, InterruptedException {
  if (message.isPersistent()) {
    if (store != null && systemUsage.getStoreUsage().isFull(getStoreUsageHighWaterMark())) {
      final String logMessage = "Persistent store is Full, " + getStoreUsageHighWaterMark() + "% of "
        + systemUsage.getStoreUsage().getLimit() + ". Stopping producer ("
        + message.getProducerId() + ") to prevent flooding "
        + getActiveMQDestination().getQualifiedName() + "."
        + " See http://activemq.apache.org/producer-flow-control.html for more info";
      waitForSpace(context, producerBrokerExchange, systemUsage.getStoreUsage(), getStoreUsageHighWaterMark(), logMessage);
    }
  } else if (messages.getSystemUsage() != null && systemUsage.getTempUsage().isFull()) {
    final String logMessage = "Temp Store is Full ("
        + systemUsage.getTempUsage().getPercentUsage() + "% of " + systemUsage.getTempUsage().getLimit()
        +"). Stopping producer (" + message.getProducerId()
      + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "."
      + " See http://activemq.apache.org/producer-flow-control.html for more info";
    waitForSpace(context, producerBrokerExchange, messages.getSystemUsage().getTempUsage(), logMessage);
  }
}

相关文章

Queue类方法