【问题标题】:How to create durable queue using Artemis JMS Management API如何使用 Artemis JMS 管理 API 创建持久队列
【发布时间】:2017-11-30 13:14:31
【问题描述】:

说来话长,但我需要使用 Artemis JMS 管理 API 创建一个持久队列。目前代码默认创建一个临时队列:

JMSManagementHelper.putOperationInvocation("jms.server", "createQueue", "MyqueueName", null, null, true);

我认为原作者认为这会创建一个持久队列,但显然不是。我找不到这方面的好文档,想知道是否有人可以确认/否认这一点。

提前致谢。

【问题讨论】:

    标签: java jms activemq-artemis


    【解决方案1】:

    这方面的文档是 GitHub 中的 https://activemq.apache.org/artemis/docs/latest/management.htmlmanagement.md。然后有the API doc可以查询详情。

    https://activemq.apache.org/artemis/docs/javadocs/javadoc-latest/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.html#createQueue-java.lang.String-java.lang.String-java.lang.String-你要调用的方法是

    createQueue(String address, String name, String filter, boolean durable)
    

    文档说

    如果地址为空,则默认为名称。

    您将name 设置为空,而不是address。如果我改为运行

    JMSManagementHelper.putOperationInvocation("0.0.0.0", "createQueue", null, "MyqueueName", null, true);
    

    这也不起作用。我相信这是一个错误。将进行更多调查并报告。

    所以我复制了队列名称

    JMSManagementHelper.putOperationInvocation("0.0.0.0", "createQueue", "MyqueueName", "MyqueueName", null, true);
    

    现在我正确地得到了一个持久队列。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-20
    • 2020-12-20
    • 1970-01-01
    • 2015-04-12
    • 2013-10-23
    • 2020-06-30
    • 2010-12-07
    • 2020-08-02
    相关资源
    最近更新 更多