Java Code Examples for org.apache.rocketmq.tools.admin.DefaultMQAdminExt#queryMessage()

The following examples show how to use org.apache.rocketmq.tools.admin.DefaultMQAdminExt#queryMessage() . 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: QueryMsgByKeySubCommand.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
private void queryByKey(final DefaultMQAdminExt admin, final String topic, final String key, boolean isSlaveFirst)
    throws MQClientException, InterruptedException, IOException {
    admin.start();

    QueryResult queryResult = admin.queryMessage(topic, key, 64, 0, Long.MAX_VALUE, isSlaveFirst);

    for (MessageExt msg : queryResult.getMessageList()) {
        System.out.printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%n");
        //System.out.printf("%-50s %4d %40d%n", msg.getMsgId(), msg.getQueueId(), msg.getQueueOffset());
        printMsg(msg);
        System.out.printf("%n");
    }
}
 
Example 2
Source File: QueryMsgByKeySubCommand.java    From rocketmq-4.3.0 with Apache License 2.0 5 votes vote down vote up
private void queryByKey(final DefaultMQAdminExt admin, final String topic, final String key)
    throws MQClientException, InterruptedException {
    admin.start();

    QueryResult queryResult = admin.queryMessage(topic, key, 64, 0, Long.MAX_VALUE);
    System.out.printf("%-50s %4s %40s%n",
        "#Message ID",
        "#QID",
        "#Offset");
    for (MessageExt msg : queryResult.getMessageList()) {
        System.out.printf("%-50s %4d %40d%n", msg.getMsgId(), msg.getQueueId(), msg.getQueueOffset());
    }
}
 
Example 3
Source File: QueryMsgByKeySubCommand.java    From rocketmq-read with Apache License 2.0 5 votes vote down vote up
private void queryByKey(final DefaultMQAdminExt admin, final String topic, final String key)
    throws MQClientException, InterruptedException {
    admin.start();

    QueryResult queryResult = admin.queryMessage(topic, key, 64, 0, Long.MAX_VALUE);
    System.out.printf("%-50s %4s %40s%n",
        "#Message ID",
        "#QID",
        "#Offset");
    for (MessageExt msg : queryResult.getMessageList()) {
        System.out.printf("%-50s %4d %40d%n", msg.getMsgId(), msg.getQueueId(), msg.getQueueOffset());
    }
}
 
Example 4
Source File: QueryMsgByKeySubCommand.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
private void queryByKey(final DefaultMQAdminExt admin, final String topic, final String key)
    throws MQClientException, InterruptedException {
    admin.start();

    QueryResult queryResult = admin.queryMessage(topic, key, 64, 0, Long.MAX_VALUE);
    System.out.printf("%-50s %4s %40s%n",
        "#Message ID",
        "#QID",
        "#Offset");
    for (MessageExt msg : queryResult.getMessageList()) {
        System.out.printf("%-50s %4d %40d%n", msg.getMsgId(), msg.getQueueId(), msg.getQueueOffset());
    }
}
 
Example 5
Source File: QueryMsgByKeySubCommand.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
private void queryByKey(final DefaultMQAdminExt admin, final String topic, final String key, boolean isSlaveFirst)
    throws MQClientException, InterruptedException, IOException {
    admin.start();

    QueryResult queryResult = admin.queryMessage(topic, key, 64, 0, Long.MAX_VALUE, isSlaveFirst);

    for (MessageExt msg : queryResult.getMessageList()) {
        System.out.printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%n");
        //System.out.printf("%-50s %4d %40d%n", msg.getMsgId(), msg.getQueueId(), msg.getQueueOffset());
        printMsg(msg);
        System.out.printf("%n");
    }
}
 
Example 6
Source File: QueryMsgByKeySubCommand.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 5 votes vote down vote up
private void queryByKey(final DefaultMQAdminExt admin, final String topic, final String key)
    throws MQClientException, InterruptedException {
    admin.start();

    QueryResult queryResult = admin.queryMessage(topic, key, 64, 0, Long.MAX_VALUE);
    System.out.printf("%-50s %4s %40s%n",
        "#Message ID",
        "#QID",
        "#Offset");
    for (MessageExt msg : queryResult.getMessageList()) {
        System.out.printf("%-50s %4d %40d%n", msg.getMsgId(), msg.getQueueId(), msg.getQueueOffset());
    }
}
 
Example 7
Source File: QueryMsgByKeySubCommand.java    From rocketmq_trans_message with Apache License 2.0 5 votes vote down vote up
private void queryByKey(final DefaultMQAdminExt admin, final String topic, final String key)
    throws MQClientException, InterruptedException {
    admin.start();

    QueryResult queryResult = admin.queryMessage(topic, key, 64, 0, Long.MAX_VALUE);
    System.out.printf("%-50s %4s %40s%n",
        "#Message ID",
        "#QID",
        "#Offset");
    for (MessageExt msg : queryResult.getMessageList()) {
        System.out.printf("%-50s %4d %40d%n", msg.getMsgId(), msg.getQueueId(), msg.getQueueOffset());
    }
}
 
Example 8
Source File: QueryMsgByKeySubCommand.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
private void queryByKey(final DefaultMQAdminExt admin, final String topic, final String key)
    throws MQClientException, InterruptedException {
    admin.start();

    QueryResult queryResult = admin.queryMessage(topic, key, 64, 0, Long.MAX_VALUE);
    System.out.printf("%-50s %4s %40s%n",
        "#Message ID",
        "#QID",
        "#Offset");
    for (MessageExt msg : queryResult.getMessageList()) {
        System.out.printf("%-50s %4d %40d%n", msg.getMsgId(), msg.getQueueId(), msg.getQueueOffset());
    }
}