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

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

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

Message.setTags介绍

暂无

代码示例

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

public Object getMessageByTag(String tag) {
  Object objMsg = null;
  if (this instanceof RMQNormalProducer) {
    org.apache.rocketmq.common.message.Message msg = new org.apache.rocketmq.common.message.Message(
      topic, (RandomUtil.getStringByUUID() + "." + new Date()).getBytes());
    objMsg = msg;
    if (tag != null) {
      msg.setTags(tag);
    }
  }
  return objMsg;
}

代码示例来源:origin: apache/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: apache/rocketmq-externals

Preconditions.checkState(!messageType.contains("||"),
  "'||' can not be in the destination when sending a message");
rocketmqMsg.setTags(messageType);
    rocketmqMsg.setKeys(value);
  } else if (MessageConst.PROPERTY_TAGS.equals(name)) {
    rocketmqMsg.setTags(value);
  } else if (MessageConst.PROPERTY_DELAY_TIME_LEVEL.equals(name)) {
    rocketmqMsg.setDelayTimeLevel(Integer.parseInt(value));

代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba

headerAccessor.setLeaveMutable(true);
toSend.setDelayTimeLevel(headerAccessor.getDelayTimeLevel());
toSend.setTags(headerAccessor.getTags());
toSend.setKeys(headerAccessor.getKeys());
toSend.setFlag(headerAccessor.getFlag());

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

public static List<Object> getMsg(String topic, int msgSize, String tag) {
  List<Object> msgs = new ArrayList<Object>();
  while (msgSize > 0) {
    Message msg = new Message(topic, (index++).toString().getBytes());
    if (tag != null) {
      msg.setTags(tag);
    }
    msgs.add(msg);
    msgSize--;
  }
  return msgs;
}

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

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: didi/DDMQ

public Object getMessageByTag(String tag) {
  Object objMsg = null;
  if (this instanceof RMQNormalProducer) {
    org.apache.rocketmq.common.message.Message msg = new org.apache.rocketmq.common.message.Message(
      topic, (RandomUtil.getStringByUUID() + "." + new Date()).getBytes());
    objMsg = msg;
    if (tag != null) {
      msg.setTags(tag);
    }
  }
  return objMsg;
}

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

message.setTopic(topic);
message.setKeys("keys123");
message.setTags("tags123");
message.setWaitStoreMsgOK(false);
message.setBuyerId("buyerid123");

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

public static List<Object> getMsg(String topic, int msgSize, String tag) {
  List<Object> msgs = new ArrayList<Object>();
  while (msgSize > 0) {
    Message msg = new Message(topic, (index++).toString().getBytes());
    if (tag != null) {
      msg.setTags(tag);
    }
    msgs.add(msg);
    msgSize--;
  }
  return msgs;
}

代码示例来源:origin: org.apache.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: didi/DDMQ

message.setTopic(topic);
message.setKeys("keys123");
message.setTags("tags123");
message.setWaitStoreMsgOK(false);
message.setBuyerId("buyerid123");

代码示例来源:origin: rstyro/Springboot

public void sendToMQ(Object object,String tags) throws Exception {
  //构造消息数据
  Message message = new Message();
  //主题
  message.setTopic(Const.PLAN_TOPIC);
  message.setTags(tags);
  //key
  String uuid = UUID.randomUUID().toString();
  message.setKeys(uuid);
  message.setBody(JSON.toJSONString(object).getBytes());
  //添加参数
  Map<String, Object> transactionMapArgs = new HashMap<String, Object>();
  this.planProducer.sendTransactionMessage(message, this.transactionExecuterImpl, transactionMapArgs);
}

代码示例来源:origin: maihaoche/rocketmq-spring-boot-starter

message.setTags(tag);

代码示例来源:origin: org.springframework.cloud/spring-cloud-stream-binder-rocketmq

headerAccessor.setLeaveMutable(true);
toSend.setDelayTimeLevel(headerAccessor.getDelayTimeLevel());
toSend.setTags(headerAccessor.getTags());
toSend.setKeys(headerAccessor.getKeys());
toSend.setFlag(headerAccessor.getFlag());

相关文章