1

Running ActiveMQ in clustered environment with a Master/Slave relationship using Oracle as a datastore. Using a jdbcPersistentAdapter.

 <jdbcPersistenceAdapter dataSource="#dataSource" createTablesOnStartup="false" lockKeepAlivePeriod="30000"/>

The activemq broker is running embedded in JBoss.

I would like to replace the dataSource bean (contains credentials and url string) with a JNDI reference since that already manages the database connection. Is this possible?

ed4becky
  • 1,488
  • 1
  • 17
  • 54

1 Answers1

1

Load the dataSourcebean from JNDI instead. Something like this should work (using a correct JNDI name from your setup).

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:comp/env/jdbc/MyDatabase"/>
</bean>
Petter Nordlander
  • 22,053
  • 5
  • 50
  • 84