use of org.apache.rocketmq.store.PutMessageResult in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class SendMessageProcessorTest method testProcessRequest_PropertiesTooLong.
@Test
public void testProcessRequest_PropertiesTooLong() throws RemotingCommandException {
when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.PROPERTIES_SIZE_EXCEEDED, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
assertPutResult(ResponseCode.MESSAGE_ILLEGAL);
}
use of org.apache.rocketmq.store.PutMessageResult in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class SendMessageProcessorTest method testProcessRequest_ServiceNotAvailable.
@Test
public void testProcessRequest_ServiceNotAvailable() throws RemotingCommandException {
when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.SERVICE_NOT_AVAILABLE, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
assertPutResult(ResponseCode.SERVICE_NOT_AVAILABLE);
}
use of org.apache.rocketmq.store.PutMessageResult in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class SendMessageProcessorTest method testProcessRequest_CreateMappedFileFailed.
@Test
public void testProcessRequest_CreateMappedFileFailed() throws RemotingCommandException {
when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.CREATE_MAPEDFILE_FAILED, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
assertPutResult(ResponseCode.SYSTEM_ERROR);
}
use of org.apache.rocketmq.store.PutMessageResult in project rocketmq by apache.
the class MessageStoreWithFilterTest method putMsg.
protected List<MessageExtBrokerInner> putMsg(DefaultMessageStore master, int topicCount, int msgCountPerTopic) throws Exception {
List<MessageExtBrokerInner> msgs = new ArrayList<MessageExtBrokerInner>();
for (int i = 0; i < topicCount; i++) {
String realTopic = topic + i;
for (int j = 0; j < msgCountPerTopic; j++) {
MessageExtBrokerInner msg = buildMessage();
msg.setTopic(realTopic);
msg.putUserProperty("a", String.valueOf(j * 10 + 5));
msg.setPropertiesString(MessageDecoder.messageProperties2String(msg.getProperties()));
PutMessageResult result = master.putMessage(msg);
msg.setMsgId(result.getAppendMessageResult().getMsgId());
msgs.add(msg);
}
}
return msgs;
}
use of org.apache.rocketmq.store.PutMessageResult in project rocketmq by apache.
the class SendMessageProcessorTest method testProcessRequest_SlaveNotAvailable.
@Test
public void testProcessRequest_SlaveNotAvailable() throws RemotingCommandException {
when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.SLAVE_NOT_AVAILABLE, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
assertPutResult(ResponseCode.SLAVE_NOT_AVAILABLE);
}
Aggregations