com.alibaba.rocketmq.common.message.Message.setTags()方法的使用及代码示例

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

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

Message.setTags介绍

暂无

代码示例

代码示例来源:origin: com.alibaba.rocketmq/rocketmq-client

public Message(String topic, String tags, String keys, int flag, byte[] body, boolean waitStoreMsgOK) {
  this.topic = topic;
  this.flag = flag;
  this.body = body;
  if (tags != null && tags.length() > 0)
    this.setTags(tags);
  if (keys != null && keys.length() > 0)
    this.setKeys(keys);
  this.setWaitStoreMsgOK(waitStoreMsgOK);
}

代码示例来源:origin: com.alibaba.rocketmq/rocketmq-common

public Message(String topic, String tags, String keys, int flag, byte[] body, boolean waitStoreMsgOK) {
  this.topic = topic;
  this.flag = flag;
  this.body = body;
  if (tags != null && tags.length() > 0)
    this.setTags(tags);
  if (keys != null && keys.length() > 0)
    this.setKeys(keys);
  this.setWaitStoreMsgOK(waitStoreMsgOK);
}

代码示例来源:origin: kuangye098/rocketmq

public Message(String topic, String tags, String keys, int flag, byte[] body, boolean waitStoreMsgOK) {
  this.topic = topic;
  this.flag = flag;
  this.body = body;
  if (tags != null && tags.length() > 0)
    this.setTags(tags);
  if (keys != null && keys.length() > 0)
    this.setKeys(keys);
  this.setWaitStoreMsgOK(waitStoreMsgOK);
}

代码示例来源:origin: songxinjianqwe/EShop-SOA

@Transactional
@Override
public void check() {
  List<Long> all = mapper.findMessageIdsByStatusCreatedAfter(Arrays.asList(MessageStatus.UNCONSUMED, MessageStatus.CONSUME_FAILED), MQProducerConfig.CHECK_GAP);
  Message checkMessage = new Message();
  checkMessage.setTopic(config.getTopic());
  checkMessage.setTags(config.getCheckKeys());
  checkMessage.setBody(ProtoStuffUtil.serialize(all));
  try {
    producer.send(checkMessage);
  } catch (Exception e) {
    log.info("发送check消息失败,暂不做处理,不会影响数据一致性");
    e.printStackTrace();
  }
}

代码示例来源:origin: beston123/Tarzan

message.setTags(TestConstants.MESSAGE_TAG);
message.setKeys(messageKey);
message.setBody(messageKey.getBytes());

相关文章