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; }
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); }
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));
headerAccessor.setLeaveMutable(true); toSend.setDelayTimeLevel(headerAccessor.getDelayTimeLevel()); toSend.setTags(headerAccessor.getTags()); toSend.setKeys(headerAccessor.getKeys()); toSend.setFlag(headerAccessor.getFlag());
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; }
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); }
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; }
message.setTopic(topic); message.setKeys("keys123"); message.setTags("tags123"); message.setWaitStoreMsgOK(false); message.setBuyerId("buyerid123");
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; }
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); }
message.setTopic(topic); message.setKeys("keys123"); message.setTags("tags123"); message.setWaitStoreMsgOK(false); message.setBuyerId("buyerid123");
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); }
message.setTags(tag);
headerAccessor.setLeaveMutable(true); toSend.setDelayTimeLevel(headerAccessor.getDelayTimeLevel()); toSend.setTags(headerAccessor.getTags()); toSend.setKeys(headerAccessor.getKeys()); toSend.setFlag(headerAccessor.getFlag());