org.apache.activemq.command.Message.isExpired()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(237)

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

Message.isExpired介绍

暂无

代码示例

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

@Override
public boolean isExpired() {
  return message.isExpired();
}

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

@Override
public boolean recoverMessage(Message message) throws Exception {
  if (message.isExpired()) {
    toExpire.add(message);
  }
  browseList.add(message);
  return true;
}

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

private boolean consumeExpiredMessage(MessageDispatch dispatch) {
  return isConsumerExpiryCheckEnabled() && dispatch.getMessage().isExpired();
}

代码示例来源: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 isSendToDeadLetterQueue(Message message) {
  boolean result = false;
  if (message != null) {
    result = true;
    if (enableAudit && messageAudit.isDuplicate(message)) {
      result = false;
      LOG.debug("Not adding duplicate to DLQ: {}, dest: {}", message.getMessageId(), message.getDestination());
    }
    if (!message.isPersistent() && !processNonPersistent) {
      result = false;
    }
    if (message.isExpired() && !processExpired) {
      result = false;
    }
  }
  return result;
}

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

@Override
public void afterCommit() throws Exception {
  // It could take while before we receive the commit
  // operation.. by that time the message could have
  // expired..
  if (message.isExpired()) {
    if (broker.isExpired(message)) {
      getDestinationStatistics().getExpired().increment();
      broker.messageExpired(context, message, null);
    }
    message.decrementReferenceCount();
    return;
  }
  try {
    dispatch(context, message);
  } finally {
    message.decrementReferenceCount();
  }
}

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

if (message.isExpired()) {
  LOG.error("message expired waiting for space");
  broker.messageExpired(context, message, null);

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

if (message.isExpired()) {
  broker.messageExpired(context, message, null);
  getDestinationStatistics().getExpired().increment();
      if (message.isExpired()) {
        getDestinationStatistics().getExpired().increment();
        LOG.debug("Expired message: {}", message);

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

@Override
  public void run() {
    try {
      // While waiting for space to free up... the
      // message may have expired.
      if (message.isExpired()) {
        broker.messageExpired(context, message, null);
        getDestinationStatistics().getExpired().increment();
      } else {
        doMessageSend(producerExchange, message);
      }
      if (sendProducerAck) {
        ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
            .getSize());
        context.getConnection().dispatchAsync(ack);
      } else {
        Response response = new Response();
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    } catch (Exception e) {
      if (!sendProducerAck && !context.isInRecoveryMode()) {
        ExceptionResponse response = new ExceptionResponse(e);
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    }
  }
});

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

final boolean sendProducerAck = !message.isResponseRequired() && producerInfo.getWindowSize() > 0
    && !context.isInRecoveryMode();
if (message.isExpired()) {
      if (message.isExpired()) {
        LOG.debug("Expired message: {}", message);
        broker.getRoot().messageExpired(context, message, null);

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

@Override
public boolean isExpired() {
  return message.isExpired();
}

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

@Override
public boolean isExpired() {
  return message.isExpired();
}

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

@Override
public boolean isExpired() {
  return message.isExpired();
}

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

public boolean isExpired() {
  return message.isExpired();
}

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

@Override
public boolean recoverMessage(Message message) throws Exception {
  if (message.isExpired()) {
    toExpire.add(message);
  }
  browseList.add(message);
  return true;
}

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

@Override
public boolean recoverMessage(Message message) throws Exception {
  if (message.isExpired()) {
    toExpire.add(message);
  }
  browseList.add(message);
  return true;
}

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

@Override
public boolean recoverMessage(Message message) throws Exception {
  if (message.isExpired()) {
    toExpire.add(message);
  }
  browseList.add(message);
  return true;
}

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

private boolean consumeExpiredMessage(MessageDispatch dispatch) {
  return isConsumerExpiryCheckEnabled() && dispatch.getMessage().isExpired();
}

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

private boolean consumeExpiredMessage(MessageDispatch dispatch) {
  return isConsumerExpiryCheckEnabled() && dispatch.getMessage().isExpired();
}

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

private boolean consumeExpiredMessage(MessageDispatch dispatch) {
  return isConsumerExpiryCheckEnabled() && dispatch.getMessage().isExpired();
}

相关文章

Message类方法