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

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

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

Message.getTags介绍

暂无

代码示例

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

private RocketMQBody buildMQBody(Message message){
  RocketMQBody mqBody = new RocketMQBody();
  mqBody.setProducerGroup(getGroupId());
  mqBody.setTopic(getTopic());
  mqBody.setTags(message.getTags());
  mqBody.setMessageKey(message.getKeys());
  mqBody.setMessageBody(message.getBody());
  return mqBody;
}

代码示例来源:origin: coffeewar/enode-master

@Override
public void sendMessageBefore(SendMessageContext context) {
  // 如果是消息轨迹本身的发送链路,则不需要再记录
  if (context == null || context.getMessage().getTopic().startsWith(MixAll.SYSTEM_TOPIC_PREFIX)) {
    return;
  }
  OnsTraceContext onsContext = new OnsTraceContext();
  onsContext.setTraceBeans(new ArrayList<OnsTraceBean>(1));
  context.setMqTraceContext(onsContext);
  onsContext.setTraceType(OnsTraceType.Pub);
  onsContext.setGroupName(context.getProducerGroup());
  OnsTraceBean traceBean = new OnsTraceBean();
  traceBean.setTopic(context.getMessage().getTopic());
  traceBean.setTags(context.getMessage().getTags());
  traceBean.setKeys(context.getMessage().getKeys());
  traceBean.setStoreHost(context.getBrokerAddr());
  traceBean.setBodyLength(context.getMessage().getBody().length);
  traceBean.setMsgType(context.getMsgType());
  onsContext.getTraceBeans().add(traceBean);
}

相关文章