activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raffaele <>
Subject Re: setDeleteAllMessagesOnStartup(true) and MySql
Date Mon, 11 Jun 2007 11:36:35 GMT

First of all, they are only test for evaluating ActiveMQ to decide if using
it in a very important Italian (but also sold in France and afterwards
perhaps in some parts of USA) project.
Then, if I'm in front of an API I search to detect all possible leaks, if
they are, before confirm to my boss that a product is a valid product to
became part of an important project.

The API permits me to do something, well, I do that "something", if it
generates an error, it is a bug. This is my point of view.

If I used NO PERSITENCE I would not have the need of
You are claiming that deleting messages on startup using PERSITENCE sounds
like using NO PERSITENCE.
Then I ask you, why your API permits me, the user, to delete messages on
startup if with either persistence true either persitence false that method
doesn't nothing of useful?

However, there could be some cases when, using persistence, and using
embedded brokers, I would like to decide if starting a broker in a "pure"
and empty database, where I would be sure that the db is empty and if it
isn't I would delete all records.
To accomplish this can I use setDeleteAllMessagesOnStartup(true) on startup
or have I to use specific SQL delete statement on activemq DB?

Thanks and best regards.


James.Strachan wrote:
> Just out of interest, why would you want to use persistence with
> MySQL, then delete messages on startup? Sounds like you'd be better
> using non-persistence.
> On 6/11/07, Raffaele <> wrote:
>> Hi all,
>> Im yet trying to do some test with a BrokerService and some settings.
>> Now, I tried with persistence on MySql and with
>> setDeleteAllMessagesOnStartup(true), here is the code:
>> ...
>> configurePersistence();
>> m_broker.addConnector("tcp://localhost:61616");
>> m_broker.setDeleteAllMessagesOnStartup(true);
>> m_broker.start();
>> // Do sending of messagges
>> ....
>> And so, with that flag set to true, the program blocks indefinitely in
>> m_broker.start(), in particular it blocks here(the bold line of code) in
>> public void deleteAllMessages() throws IOException {
>>         TransactionContext c = getTransactionContext();
>>         try {
>>             getAdapter().doDropTables(c);
>> getAdapter().setUseExternalMessageReferences(isUseExternalMessageReferences());
>>             getAdapter().doCreateTables(c);
>>         } catch (SQLException e) {
>>             JDBCPersistenceAdapter.log("JDBC Failure: ",e);
>>             throw IOExceptionSupport.create(e);
>>         } finally {
>>             c.close();
>>         }
>>     }
>> Any hint?
>> Best regards,
>> Raffaele
>> --
>> View this message in context:
>> Sent from the ActiveMQ - User mailing list archive at
> -- 
> James
> -------

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message