代码之家  ›  专栏  ›  技术社区  ›  sagneta

如何使用Artemis JMS管理API创建持久队列

  •  4
  • sagneta  · 技术社区  · 8 年前

    说来话长,但我需要创造一个 耐用的 使用Artemis JMS管理API排队。当前,代码会创建一个临时队列作为默认值:

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

    我认为最初的作者假设这将创建一个持久的队列,但显然不是。我找不到这方面的好文件,不知道是否有人可以证实/否认这一点。

    1 回复  |  直到 8 年前
        1
  •  2
  •   user7610    7 年前

    https://activemq.apache.org/artemis/docs/latest/management.html management.md 在GitHub中。然后是 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);
    

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