Search in sources :

Example 11 with AppendMessageResult

use of org.apache.rocketmq.store.AppendMessageResult in project rocketmq by apache.

the class SendMessageProcessorTest method testProcessRequest_FlushTimeOut.

@Test
public void testProcessRequest_FlushTimeOut() throws RemotingCommandException {
    when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.FLUSH_DISK_TIMEOUT, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
    assertPutResult(ResponseCode.FLUSH_DISK_TIMEOUT);
}
Also used : PutMessageResult(org.apache.rocketmq.store.PutMessageResult) MessageExtBrokerInner(org.apache.rocketmq.store.MessageExtBrokerInner) AppendMessageResult(org.apache.rocketmq.store.AppendMessageResult) Test(org.junit.Test)

Example 12 with AppendMessageResult

use of org.apache.rocketmq.store.AppendMessageResult in project rocketmq by apache.

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);
}
Also used : PutMessageResult(org.apache.rocketmq.store.PutMessageResult) MessageExtBrokerInner(org.apache.rocketmq.store.MessageExtBrokerInner) AppendMessageResult(org.apache.rocketmq.store.AppendMessageResult) Test(org.junit.Test)

Example 13 with AppendMessageResult

use of org.apache.rocketmq.store.AppendMessageResult in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class SendMessageProcessorTest method testProcessRequest_PageCacheBusy.

@Test
public void testProcessRequest_PageCacheBusy() throws RemotingCommandException {
    when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.OS_PAGECACHE_BUSY, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
    assertPutResult(ResponseCode.SYSTEM_ERROR);
}
Also used : PutMessageResult(org.apache.rocketmq.store.PutMessageResult) MessageExtBrokerInner(org.apache.rocketmq.store.MessageExtBrokerInner) AppendMessageResult(org.apache.rocketmq.store.AppendMessageResult) Test(org.junit.Test)

Example 14 with AppendMessageResult

use of org.apache.rocketmq.store.AppendMessageResult in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

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);
}
Also used : PutMessageResult(org.apache.rocketmq.store.PutMessageResult) MessageExtBrokerInner(org.apache.rocketmq.store.MessageExtBrokerInner) AppendMessageResult(org.apache.rocketmq.store.AppendMessageResult) Test(org.junit.Test)

Example 15 with AppendMessageResult

use of org.apache.rocketmq.store.AppendMessageResult in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class SendMessageProcessorTest method testProcessRequest_FlushSlaveTimeout.

@Test
public void testProcessRequest_FlushSlaveTimeout() throws RemotingCommandException {
    when(messageStore.putMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult(PutMessageStatus.FLUSH_SLAVE_TIMEOUT, new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR)));
    assertPutResult(ResponseCode.FLUSH_SLAVE_TIMEOUT);
}
Also used : PutMessageResult(org.apache.rocketmq.store.PutMessageResult) MessageExtBrokerInner(org.apache.rocketmq.store.MessageExtBrokerInner) AppendMessageResult(org.apache.rocketmq.store.AppendMessageResult) Test(org.junit.Test)

Aggregations

AppendMessageResult (org.apache.rocketmq.store.AppendMessageResult)22 MessageExtBrokerInner (org.apache.rocketmq.store.MessageExtBrokerInner)22 PutMessageResult (org.apache.rocketmq.store.PutMessageResult)22 Test (org.junit.Test)22 ArrayList (java.util.ArrayList)2 SendMessageContext (org.apache.rocketmq.broker.mqtrace.SendMessageContext)2 SendMessageHook (org.apache.rocketmq.broker.mqtrace.SendMessageHook)2 RemotingCommand (org.apache.rocketmq.remoting.protocol.RemotingCommand)2