use of org.apache.rocketmq.tools.admin.api.MessageTrack in project rocketmq-externals by apache.
the class MessageServiceImpl method viewMessage.
public Pair<MessageView, List<MessageTrack>> viewMessage(String subject, final String msgId) {
try {
MessageExt messageExt = mqAdminExt.viewMessage(subject, msgId);
List<MessageTrack> messageTrackList = messageTrackDetail(messageExt);
return new Pair<>(MessageView.fromMessageExt(messageExt), messageTrackList);
} catch (Exception e) {
throw Throwables.propagate(e);
}
}
use of org.apache.rocketmq.tools.admin.api.MessageTrack in project rocketmq-externals by apache.
the class MessageServiceImplTest method viewMessage.
@Test
public void viewMessage() throws Exception {
final String messageId = msgId;
Pair<MessageView, List<MessageTrack>> messageViewListPair = new RetryTempLate<Pair<MessageView, List<MessageTrack>>>() {
@Override
protected Pair<MessageView, List<MessageTrack>> process() throws Exception {
return messageService.viewMessage(TEST_CONSOLE_TOPIC, messageId);
}
}.execute(10, 1000);
MessageView messageView = messageViewListPair.getObject1();
Assert.assertEquals(messageView.getMessageBody(), TEST_TOPIC_MESSAGE_BODY);
}
use of org.apache.rocketmq.tools.admin.api.MessageTrack in project rocketmq-externals by apache.
the class MessageServiceImplTest method messageTrackDetail.
@Test
public void messageTrackDetail() throws Exception {
final String messageId = msgId;
Pair<MessageView, List<MessageTrack>> messageViewListPair = new RetryTempLate<Pair<MessageView, List<MessageTrack>>>() {
@Override
protected Pair<MessageView, List<MessageTrack>> process() throws Exception {
return messageService.viewMessage(TEST_CONSOLE_TOPIC, messageId);
}
}.execute(10, // make the topic can be found
1000);
final MessageExt messageExt = mqAdminExt.viewMessage(TEST_CONSOLE_TOPIC, messageId);
Assert.assertNotNull(messageService.messageTrackDetail(messageExt));
}
Aggregations