You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by navneek <na...@gmail.com> on 2007/10/25 13:28:16 UTC

Messages are not getting persisted in database table.(jdbcPersistenceAdapter>

Hi,

Im using the following configuration for persisting messages into oracle
database. Ultimately When I start activemq the tables (activemq_acks,
activemq_lock, activemq_msgs) are created but it is not holding any message
in table named 'activemq_msgs'. When I post messages into Broker, msg
staying in broker only... but msg are not going into dadabase
table(activemq_msgs).Table data remains empty.. Please let me know if im
missing anymore configuration. I want to populate this table with the
messages im posting in broker.

My configuration:
--------------------------------------
<broker xmlns="http://activemq.org/config/1.0" brokerName="localhost"
persistent="true">
 <persistenceAdapter>
        <jdbcPersistenceAdapter dataSource="#oracle-ds"
useDatabaseLock="true"/>
    </persistenceAdapter>

<bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
    <property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver"/>
    <property name="url" value="jdbc:oracle:thin:@mydb:1521:orclcore"/>
    <property name="username" value="scott"/>
    <property name="password" value="testpw"/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>

-- 
View this message in context: http://www.nabble.com/Messages-are-not-getting-persisted-in-database-table.%28jdbcPersistenceAdapter%3E-tf4690259s2354.html#a13404857
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Messages are not getting persisted in database table.(jdbcPersistenceAdapter>

Posted by Hiram Chirino <hi...@hiramchirino.com>.
What version you using?

On Oct 25, 2007 6:28 AM, navneek <na...@gmail.com> wrote:
>
> Hi,
>
> Im using the following configuration for persisting messages into oracle
> database. Ultimately When I start activemq the tables (activemq_acks,
> activemq_lock, activemq_msgs) are created but it is not holding any message
> in table named 'activemq_msgs'. When I post messages into Broker, msg
> staying in broker only... but msg are not going into dadabase
> table(activemq_msgs).Table data remains empty.. Please let me know if im
> missing anymore configuration. I want to populate this table with the
> messages im posting in broker.
>
> My configuration:
> --------------------------------------
> <broker xmlns="http://activemq.org/config/1.0" brokerName="localhost"
> persistent="true">
>  <persistenceAdapter>
>         <jdbcPersistenceAdapter dataSource="#oracle-ds"
> useDatabaseLock="true"/>
>     </persistenceAdapter>
>
> <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
>     <property name="driverClassName"
> value="oracle.jdbc.driver.OracleDriver"/>
>     <property name="url" value="jdbc:oracle:thin:@mydb:1521:orclcore"/>
>     <property name="username" value="scott"/>
>     <property name="password" value="testpw"/>
>     <property name="poolPreparedStatements" value="true"/>
>   </bean>
>
> --
> View this message in context: http://www.nabble.com/Messages-are-not-getting-persisted-in-database-table.%28jdbcPersistenceAdapter%3E-tf4690259s2354.html#a13404857
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com

Re: Messages are not getting persisted in database table.(jdbcPersistenceAdapter>

Posted by emh <mi...@gmx.de>.
Hi,

Does anyone have a solution for that problem? I am currently facing the
problem too, except that I am working with ActiveMQ and a MySQL database.
The tables are being created but they stay empty all the time. If I insert
messages in a queue and restart the broker, the queued messages are lost.
Does anybody know how to configure ActiveMQ that the database tables are
actually used?

Thanks, emh

This is the configuration I use; its quite similar to the configuration from
navneek:
<persistenceAdapter>
        <journaledJDBC journalLogFiles="5"
dataDirectory="${activemq.base}/activemq-data" dataSource="#mysql-ds"
useDatabaseLock="false"/>
    </persistenceAdapter>

<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url"
value="jdbc:mysql://localhost/activemq?createDatabaseIfNotExist=true&amp;relaxAutoCommit=true"/>
    <property name="username" value="username"/>
    <property name="password" value="password"/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>


navneek wrote:
> 
> Hi,
> 
> Im using the following configuration for persisting messages into oracle
> database. Ultimately When I start activemq the tables (activemq_acks,
> activemq_lock, activemq_msgs) are created but it is not holding any
> message in table named 'activemq_msgs'. When I post messages into Broker,
> msg staying in broker only... but msg are not going into dadabase
> table(activemq_msgs).Table data remains empty.. Please let me know if im
> missing anymore configuration. I want to populate this table with the
> messages im posting in broker.
> 

-- 
View this message in context: http://www.nabble.com/Messages-are-not-getting-persisted-in-database-table.%28jdbcPersistenceAdapter%3E-tp13404857s2354p14418955.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.