views:

56

answers:

1

Hi,

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();

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

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.

Cheers, Max

A: 

Hi,

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

you can see info on Bug 2935 of ActiveMQ ( https://issues.apache.org/activemq/browse/AMQ-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

Noctris
Thanks for your reply. Changing the persistence store would add another dependency for something I don't intend to use.
Max
so basically you do not want persistence and it's not taking the code configuration. What i've read is that the setting will be ignored when a persistence adapter is set. Maybe you could try clearing the adapters ( incase one has been set by default, altough looking at the source, it uses the MemoryPersistence) before starting ? Other then that, i would say it is a bug an needs to be registered in jira :s
Noctris