ActiveMQ 忽略持久= false
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
除了添加 persistant="false" 之外,解决方案是在 activemq.xml 中注释掉以下几行:
此外,此时清除数据目录不会造成任何伤害...
The solution, in addition to adding the persistant="false" is to comment out the following lines in your activemq.xml:
Also, doesn't hurt at this point to purge your data directory...
我会使用 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
即使在注释持久适配器时,它也会创建该目录。但是,当代理 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.