没有持久性的ActiveMQ [英] ActiveMQ without persistence

查看:103
本文介绍了没有持久性的ActiveMQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在产生消息的服务器和许多接收消息的客户端之间建立基于发布者-订阅者的通信协议。经过一些研究,我决定使用ActiveMQ。我查看了一些教程和ActiveMQ网站,并按如下所示设置了代理:

I'd like to set up a publisher-subscriber based communication protocol between a server producing messages and many clients receiving them. After a bit of research, I decided to go with ActiveMQ. I looked at a few tutorials and the ActiveMQ site and set up the broker as follows:

BrokerService broker = new BrokerService();
broker.setPersistent(false);
broker.addConnector("tcp://localhost:61616");
broker.start();

我只需要消息传递功能,不需要数据库持久性或类似功能。但是,当我启动应用程序时,无论配置如何,都会创建一个activemq-data文件夹。依次导致下次我启动代理时发生异常。

I only need the message passing functionality, no database persistence or anything alike. However, when I start the application, a activemq-data folder is created regardless of the the configuration. This in turn causes an exception the next time I start the broker.

SEVERE: Failed to start ActiveMQ JMS Message Broker. Reason: java.io.EOFException: Chunk stream does not exist at page: 0

这是一个错误还是我没有正确设置代理(使用ActiveMQ 5.4.1)?如何禁用持久性,这样就不会创建其他数据存储?此外,我更喜欢从Java应用程序而不是通过xml文件配置代理。

Is this a bug or am I not setting up the broker correctly (using ActiveMQ 5.4.1)? How can I disable persistence, so the additional data storage is not created? Also, I prefer to configure the broker from within the Java application and not through an xml file.

干杯,
Max

Cheers, Max

推荐答案

这不是正常行为,而是KahaDB(Activemq中的默认持久性存储)中的错误

This is not normal behaviour but a bug in KahaDB (the default persistence store in Activemq)

您可以在 ActiveMQ的错误2935 上看到信息。

您可以通过选择其他持久性引擎来解决此问题,尽管我曾几次遇到此问题,然后消失了

You could solve this by choosing a different persistence engine, although i strangly had this problem a couple of times and then it dissapeared

这篇关于没有持久性的ActiveMQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆