org.apache.rocketmq.common.message.Message.getDelayTimeLevel()方法的使用及代码示例

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

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

Message.getDelayTimeLevel介绍

暂无

代码示例

代码示例来源:origin: didi/DDMQ

public static MessageBatch generateFromList(Collection<Message> messages) {
  assert messages != null;
  assert messages.size() > 0;
  List<Message> messageList = new ArrayList<Message>(messages.size());
  Message first = null;
  for (Message message : messages) {
    if (message.getDelayTimeLevel() > 0) {
      throw new UnsupportedOperationException("TimeDelayLevel in not supported for batching");
    }
    if (message.getTopic().startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX)) {
      throw new UnsupportedOperationException("Retry Group is not supported for batching");
    }
    if (first == null) {
      first = message;
    } else {
      if (!first.getTopic().equals(message.getTopic())) {
        throw new UnsupportedOperationException("The topic of the messages in one batch should be the same");
      }
      if (first.isWaitStoreMsgOK() != message.isWaitStoreMsgOK()) {
        throw new UnsupportedOperationException("The waitStoreMsgOK of the messages in one batch should the same");
      }
    }
    messageList.add(message);
  }
  MessageBatch messageBatch = new MessageBatch(messageList);
  messageBatch.setTopic(first.getTopic());
  messageBatch.setWaitStoreMsgOK(first.isWaitStoreMsgOK());
  return messageBatch;
}

代码示例来源:origin: jiangxinlingdu/rocketmq-all-4.1.0-incubating

public static MessageBatch generateFromList(Collection<Message> messages) {
  assert messages != null;
  assert messages.size() > 0;
  List<Message> messageList = new ArrayList<Message>(messages.size());
  Message first = null;
  for (Message message : messages) {
    if (message.getDelayTimeLevel() > 0) {
      throw new UnsupportedOperationException("TimeDelayLevel in not supported for batching");
    }
    if (message.getTopic().startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX)) {
      throw new UnsupportedOperationException("Retry Group is not supported for batching");
    }
    if (first == null) {
      first = message;
    } else {
      if (!first.getTopic().equals(message.getTopic())) {
        throw new UnsupportedOperationException("The topic of the messages in one batch should be the same");
      }
      if (first.isWaitStoreMsgOK() != message.isWaitStoreMsgOK()) {
        throw new UnsupportedOperationException("The waitStoreMsgOK of the messages in one batch should the same");
      }
    }
    messageList.add(message);
  }
  MessageBatch messageBatch = new MessageBatch(messageList);
  messageBatch.setTopic(first.getTopic());
  messageBatch.setWaitStoreMsgOK(first.isWaitStoreMsgOK());
  return messageBatch;
}

代码示例来源:origin: org.apache.rocketmq/rocketmq-common

public static MessageBatch generateFromList(Collection<Message> messages) {
  assert messages != null;
  assert messages.size() > 0;
  List<Message> messageList = new ArrayList<Message>(messages.size());
  Message first = null;
  for (Message message : messages) {
    if (message.getDelayTimeLevel() > 0) {
      throw new UnsupportedOperationException("TimeDelayLevel in not supported for batching");
    }
    if (message.getTopic().startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX)) {
      throw new UnsupportedOperationException("Retry Group is not supported for batching");
    }
    if (first == null) {
      first = message;
    } else {
      if (!first.getTopic().equals(message.getTopic())) {
        throw new UnsupportedOperationException("The topic of the messages in one batch should be the same");
      }
      if (first.isWaitStoreMsgOK() != message.isWaitStoreMsgOK()) {
        throw new UnsupportedOperationException("The waitStoreMsgOK of the messages in one batch should the same");
      }
    }
    messageList.add(message);
  }
  MessageBatch messageBatch = new MessageBatch(messageList);
  messageBatch.setTopic(first.getTopic());
  messageBatch.setWaitStoreMsgOK(first.isWaitStoreMsgOK());
  return messageBatch;
}

相关文章