You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Tomasz Pik <to...@gmail.com> on 2009/04/15 08:40:14 UTC

Embedding AcitveMQ with JDBC persistence

Hello,

I'm trying to embed activemq in web application, using JDBC for persistence.
During startup tables in database are created but activemq is still using
kaha files for persistence.
Here's my config file:

<bean id="dataSource" name="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
...
</bean>

<amq:jdbcPersistenceAdapter id="persistenceAdapter"
useDatabaseLock="false" dataSource="#dataSource"/>
<bean class="org.apache.activemq.store.PersistenceAdapterFactoryBean"/>

<amq:broker useJmx="false" persistent="false"
persistenceAdapter="#persistenceAdapter">
  <amq:transportConnectors>
    <amq:transportConnector uri="vm://alamakota" />
  </amq:transportConnectors>
</amq:broker>

<amq:connectionFactory id="jmsFactory" brokerURL="vm://alamakota"/>
<amq:queue id="jmsQueue" physicalName="alama"/>

What should I do to get rid of 'activemq-data' directory (on
production serwer I won't be able
to write to filesystem) and use database for persistence.

Thanks in advance,
Tomek