【问题标题】:How to create queue in EmbeddedActiveMQBroker? [closed]如何在 EmbeddedActiveMQBroker 中创建队列? [关闭]
【发布时间】:2021-09-21 01:24:44
【问题描述】:

我正在使用 EmbeddedActiveMQBroker 并且想知道如何为 Spring 测试创建队列? 试过这个,但失败了:

getBrokerService().setDestinations(new ActiveMQQueue[] {new ActiveMQQueue("reply-queue")});

【问题讨论】:

  • 您使用的是什么版本的 ActiveMQ?究竟是什么失败了?您是否在日志中收到异常或错误消息?请澄清。

标签: spring activemq


【解决方案1】:

默认情况下会自动创建队列和主题。只需启动代理,客户端连接就会为您创建目的地。

如果你确实必须在客户端连接之前有目的地存在,你可以使用 brokerService.getAdminView().addQueue(String queueName)

【讨论】:

    猜你喜欢
    • 2016-03-01
    • 2011-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多