Java Code Examples for org.apache.rocketmq.common.protocol.header.SendMessageRequestHeader#setBornTimestamp()

The following examples show how to use org.apache.rocketmq.common.protocol.header.SendMessageRequestHeader#setBornTimestamp() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SendMessageProcessorTest.java    From DDMQ with Apache License 2.0 6 votes vote down vote up
private RemotingCommand createSendMsgCommand(int requestCode) {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(group);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(MixAll.DEFAULT_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(1);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    requestHeader.setReconsumeTimes(0);

    RemotingCommand request = RemotingCommand.createRequestCommand(requestCode, requestHeader);
    request.setBody(new byte[] {'a'});
    request.makeCustomHeaderToNet();
    return request;
}
 
Example 2
Source File: SendMessageProcessorTest.java    From rocketmq_trans_message with Apache License 2.0 6 votes vote down vote up
private RemotingCommand createSendMsgCommand(int requestCode) {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(group);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(MixAll.DEFAULT_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(1);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    requestHeader.setReconsumeTimes(0);

    RemotingCommand request = RemotingCommand.createRequestCommand(requestCode, requestHeader);
    request.setBody(new byte[] {'a'});
    request.makeCustomHeaderToNet();
    return request;
}
 
Example 3
Source File: SendMessageProcessorTest.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 6 votes vote down vote up
private RemotingCommand createSendMsgCommand(int requestCode) {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(group);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(MixAll.DEFAULT_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(1);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    requestHeader.setReconsumeTimes(0);

    RemotingCommand request = RemotingCommand.createRequestCommand(requestCode, requestHeader);
    request.setBody(new byte[] {'a'});
    request.makeCustomHeaderToNet();
    return request;
}
 
Example 4
Source File: ReplyMessageProcessorTest.java    From rocketmq with Apache License 2.0 6 votes vote down vote up
private SendMessageRequestHeader createSendMessageRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(group);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(TopicValidator.AUTO_CREATE_TOPIC_KEY_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(1);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    requestHeader.setReconsumeTimes(0);
    Map<String, String> map = new HashMap<String, String>();
    map.put(MessageConst.PROPERTY_MESSAGE_REPLY_TO_CLIENT, "127.0.0.1");
    requestHeader.setProperties(MessageDecoder.messageProperties2String(map));
    return requestHeader;
}
 
Example 5
Source File: SendMessageProcessorTest.java    From rocketmq with Apache License 2.0 6 votes vote down vote up
private RemotingCommand createSendMsgCommand(int requestCode) {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(group);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(MixAll.DEFAULT_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(1);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    requestHeader.setReconsumeTimes(0);

    RemotingCommand request = RemotingCommand.createRequestCommand(requestCode, requestHeader);
    request.setBody(new byte[] {'a'});
    request.makeCustomHeaderToNet();
    return request;
}
 
Example 6
Source File: DeFiReplyMessageProcessorTest.java    From DeFiBus with Apache License 2.0 6 votes vote down vote up
private SendMessageRequestHeader createSendMsgRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(group);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(MixAll.AUTO_CREATE_TOPIC_KEY_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(1);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    Message msg = new Message();
    msg.putUserProperty(DeFiBusConstant.KEY, DeFiBusConstant.REPLY);
    msg.putUserProperty(DeFiBusConstant.PROPERTY_MESSAGE_REPLY_TO, clientId);
    msg.setBody(new String("abcd").getBytes());
    requestHeader.setProperties(MessageDecoder.messageProperties2String(msg.getProperties()));
    return requestHeader;
}
 
Example 7
Source File: MessageRedirectManagerTest.java    From DeFiBus with Apache License 2.0 6 votes vote down vote up
private SendMessageRequestHeader createSendMsgRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(group);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(MixAll.AUTO_CREATE_TOPIC_KEY_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(1);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    Message msg = new Message();
    msg.putUserProperty(DeFiBusConstant.KEY, DeFiBusConstant.REPLY);
    msg.putUserProperty(DeFiBusConstant.PROPERTY_MESSAGE_REPLY_TO, clientId);
    msg.setBody(new String("abcd").getBytes());
    requestHeader.setProperties(MessageDecoder.messageProperties2String(msg.getProperties()));
    return requestHeader;
}
 
Example 8
Source File: BrokerFuseTest.java    From DeFiBus with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMsgRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(producerGroup);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(MixAll.AUTO_CREATE_TOPIC_KEY_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(queueId);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    requestHeader.setReconsumeTimes(0);
    return requestHeader;
}
 
Example 9
Source File: DeFiSendMessageProcessorTest.java    From DeFiBus with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMsgRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(group);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(MixAll.AUTO_CREATE_TOPIC_KEY_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(1);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    requestHeader.setReconsumeTimes(0);
    return requestHeader;
}
 
Example 10
Source File: MQClientAPIImplTest.java    From rocketmq-read with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMessageRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setTopic(topic);
    requestHeader.setProducerGroup(group);
    requestHeader.setQueueId(1);
    requestHeader.setMaxReconsumeTimes(10);
    return requestHeader;
}
 
Example 11
Source File: MQClientAPIImplTest.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMessageRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setTopic(topic);
    requestHeader.setProducerGroup(group);
    requestHeader.setQueueId(1);
    requestHeader.setMaxReconsumeTimes(10);
    return requestHeader;
}
 
Example 12
Source File: MQClientAPIImplTest.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMessageRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setTopic(topic);
    requestHeader.setProducerGroup(group);
    requestHeader.setQueueId(1);
    requestHeader.setMaxReconsumeTimes(10);
    return requestHeader;
}
 
Example 13
Source File: SendMessageProcessorTest.java    From rocketmq-4.3.0 with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMsgRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(group);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(MixAll.AUTO_CREATE_TOPIC_KEY_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(1);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    requestHeader.setReconsumeTimes(0);
    return requestHeader;
}
 
Example 14
Source File: MQClientAPIImplTest.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMessageRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setTopic(topic);
    requestHeader.setProducerGroup(group);
    requestHeader.setQueueId(1);
    requestHeader.setMaxReconsumeTimes(10);
    return requestHeader;
}
 
Example 15
Source File: MQClientAPIImplTest.java    From rocketmq-4.3.0 with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMessageRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setTopic(topic);
    requestHeader.setProducerGroup(group);
    requestHeader.setQueueId(1);
    requestHeader.setMaxReconsumeTimes(10);
    return requestHeader;
}
 
Example 16
Source File: Detector.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader getMessageRequestHeader(Message msg, MessageQueue mq) {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(producer.getProducerGroup());
    requestHeader.setTopic(msg.getTopic());
    requestHeader.setDefaultTopic(producer.getCreateTopicKey());
    requestHeader.setDefaultTopicQueueNums(producer.getDefaultTopicQueueNums());
    requestHeader.setQueueId(mq.getQueueId());
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(msg.getFlag());
    requestHeader.setProperties(MessageDecoder.messageProperties2String(msg.getProperties()));
    requestHeader.setReconsumeTimes(0);
    requestHeader.setUnitMode(producer.isUnitMode());
    return requestHeader;
}
 
Example 17
Source File: SendMessageProcessorTest.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMsgRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(group);
    requestHeader.setTopic(topic);
    requestHeader.setDefaultTopic(TopicValidator.AUTO_CREATE_TOPIC_KEY_TOPIC);
    requestHeader.setDefaultTopicQueueNums(3);
    requestHeader.setQueueId(1);
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(124);
    requestHeader.setReconsumeTimes(0);
    return requestHeader;
}
 
Example 18
Source File: Detector.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader getMessageRequestHeader(Message msg, MessageQueue mq) {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setProducerGroup(producer.getProducerGroup());
    requestHeader.setTopic(msg.getTopic());
    requestHeader.setDefaultTopic(producer.getCreateTopicKey());
    requestHeader.setDefaultTopicQueueNums(producer.getDefaultTopicQueueNums());
    requestHeader.setQueueId(mq.getQueueId());
    requestHeader.setSysFlag(0);
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setFlag(msg.getFlag());
    requestHeader.setProperties(MessageDecoder.messageProperties2String(msg.getProperties()));
    requestHeader.setReconsumeTimes(0);
    requestHeader.setUnitMode(producer.isUnitMode());
    return requestHeader;
}
 
Example 19
Source File: MQClientAPIImplTest.java    From rocketmq_trans_message with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMessageRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setTopic(topic);
    requestHeader.setProducerGroup(group);
    requestHeader.setQueueId(1);
    requestHeader.setMaxReconsumeTimes(10);
    return requestHeader;
}
 
Example 20
Source File: MQClientAPIImplTest.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
private SendMessageRequestHeader createSendMessageRequestHeader() {
    SendMessageRequestHeader requestHeader = new SendMessageRequestHeader();
    requestHeader.setBornTimestamp(System.currentTimeMillis());
    requestHeader.setTopic(topic);
    requestHeader.setProducerGroup(group);
    requestHeader.setQueueId(1);
    requestHeader.setMaxReconsumeTimes(10);
    return requestHeader;
}