ActiveMQ 忽略持久= false

发布于 2024-09-06 04:47:56 字数 508 浏览 2 评论 0原文

我正在使用 Active MQ 来集成测试我的应用程序。我在 spring 配置中定义了一个 active-mq 代理,如下所示:

<amq:broker useJmx="false" 
           persistent="false" 
           deleteAllMessagesOnStartup="true" 
           useShutdownHook="true">

    <amq:transportConnectors>
        <amq:transportConnector uri="tcp://localhost:0"/>
    </amq:transportConnectors>
</amq:broker>

但它似乎忽略了 persistent=false ,每次运行测试套件时,我都会创建一个名为 activemq- 的文件夹data

我需要做什么才能使 Active MQ 不持久?

I am using Active MQ for integration testing my application. I have defined an active-mq broker in a spring config like so:

<amq:broker useJmx="false" 
           persistent="false" 
           deleteAllMessagesOnStartup="true" 
           useShutdownHook="true">

    <amq:transportConnectors>
        <amq:transportConnector uri="tcp://localhost:0"/>
    </amq:transportConnectors>
</amq:broker>

But it seems to be ignoring persistent=false and every time I run the test suite I get a folder created called activemq-data

What do I need to do so that Active MQ is not persistent?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

宛菡 2024-09-13 04:47:56

除了添加 persistant="false" 之外,解决方案是在 activemq.xml 中注释掉以下几行:

 <persistenceAdapter>
            <kahaDB directory="${activemq.base}/data/kahadb"/>
 </persistenceAdapter>

此外,此时清除数据目录不会造成任何伤害...

The solution, in addition to adding the persistant="false" is to comment out the following lines in your activemq.xml:

 <persistenceAdapter>
            <kahaDB directory="${activemq.base}/data/kahadb"/>
 </persistenceAdapter>

Also, doesn't hurt at this point to purge your data directory...

楠木可依 2024-09-13 04:47:56

我会使用 ActiveMQ 5.3.2 - 这看起来像是一个旧版本。
顺便说一句 - 你不需要删除AllMessagesOnStartup - 因为你不会使用持久消息存储

欢呼,

罗布

I would use ActiveMQ 5.3.2 - this looks like an older release.
Btw - you don't need to deleteAllMessagesOnStartup - as you won't be using a persistent message store

cheers,

Rob

多孤肩上扛 2024-09-13 04:47:56

即使在注释持久适配器时,它也会创建该目录。但是,当代理 URL 中包含 et brosker.persistent=false 时,持久性将被禁用。我仍然想知道为什么,目前,这是在 5.4.2 中。

Even on commenting the persistent adapter, it creates that directory. When is et broker.persistent=false in the broker URL, though, the persistence gets disabled. I'm still wondering why, and at this point, this is in 5.4.2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文