【问题标题】:SUN IMQ topic messages previewSUN IMQ 主题消息预览
【发布时间】:2010-02-11 04:24:35
【问题描述】:

有没有办法查看驻留在 JMS 主题目标中的消息?

我遇到了一个问题,即没有从主题目标发布消息。该主题有 1 个生产者和 7 个消费者,但没有一个是持久的。

提前感谢您的任何建议。

【问题讨论】:

    标签: jms sun


    【解决方案1】:

    经过一番挖掘终于找到了答案。

    我需要使用以下命令:

    imqcmd list msg -t t -n my_topic -nocheck
    

    其中 my_topic 是我的主题目的地的名称。 收到如下回复后:

    Listing messages for the destination
    ------------------------------------
    Destination Name    Destination Type
    ------------------------------------
    my_queue            Topic
    
    On the broker specified by:
    
    -------------------------
    Host         Primary Port
    -------------------------
    localhost    7676
    
    --------------------------------------------------------------------------------------------------
    Message #   Message IDs                                                     Priority   Body Type
    --------------------------------------------------------------------------------------------------
    0           ID:9-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169630     4          TextMessage
    1           ID:10-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169709    4          TextMessage
    2           ID:11-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169717    4          TextMessage
    3           ID:12-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169720    4          TextMessage
    4           ID:13-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169723    4          TextMessage
    5           ID:14-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169727    4          TextMessage
    

    我可以用这个命令查看消息详情:

    imqcmd query msg -t t -n my_topic -msgID "ID:9-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169630" -nocheck
    

    会打印出类似的东西:

    Querying message:
    ------------------------------------------------------------
    Message ID
    ------------------------------------------------------------
    ID:9-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169630
    
    In the destination
    ------------------------------------
    Destination Name    Destination Type
    ------------------------------------
    my_topic            Topic
    
    On the broker specified by:
    
    -------------------------
    Host         Primary Port
    -------------------------
    localhost    7676
    
    --------------------------
    Message Header Information
    --------------------------
    Message ID                  ID:9-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169630
    Correlation ID              TestCorrID
    Destination Name            my_topic
    Destination Type            Topic
    Delivery Mode               PERSISTENT (2)
    Priority                    4
    Redelivered                 false
    Timestamp                   7/30/08 3:32:49 PM
    Type                        
    Expiration                  12/31/69 4:00:00 PM
    ReplyTo Destination Name    temporary_destination://topic/AAA.BBB.CCC.DDD/58798/1
    ReplyTo Destination Type    
    
    ------------------------------
    Message Properties Information
    ------------------------------
    LongProp      6534
    IntProp       3
    StringProp    TestStringValue
    DoubleProp    7.4687643E7
    
    ------------------------
    Message Body Information
    ------------------------
    Body Type    TextMessage (1)
    

    之后可以使用命令删除消息:

    imqcmd destroy msg -t t -n my_topic-msgID "ID:9-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169630" -nocheck
    

    希望有一天这对某人有所帮助......

    【讨论】:

    • 谢谢.. 今天帮助了我
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-16
    • 2017-06-12
    • 2018-09-30
    • 2016-12-23
    • 2010-09-07
    • 1970-01-01
    • 2015-03-25
    相关资源
    最近更新 更多