activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From petera <peter.ander...@egsgroup.com>
Subject Re: Postgres persistence in Tomcat
Date Thu, 07 Sep 2006 08:10:51 GMT

Adrian,

Thanks for your help. The documentation is a bit patchy on actually setting
up the messaging database.

Do I just create an activemq database in postgres and then activemq
automatically creates the tables it requires. Or do I
need to create some tables for it to use ?

TIA Peter



Adrian Co wrote:
> 
> Hi,
> 
> One way I could think of is to configure your broker using an external 
> config file (i.e. activemq.xml) and just change the dataSource of the 
> persistence adapter to postgres. Example:
> https://svn.apache.org/repos/asf/incubator/activemq/trunk/assembly/src/release/conf/activemq.xml
> 
> Just uncomment the postgres-ds bean and uncomment the reference in the 
> persistence adapter.
> 
> And use that config file to configure your embedded broker. i.e.
> brokerURL="vm://localhost?brokerConfig=xbean:activemq.xml" <- assuming 
> activemq.xml is in the classpath
> 
> or
> 
> brokerURL="vm://localhost?brokerConfig=xbean:file:c:/activemq.xml" <- 
> for file path referencing
> 
> Hope this helps.
> 
> Regards,
> Adrian Co
> 
> petera wrote:
>> Hi,
>>
>> I am using ActiveMQ 4.0.1 running under Tomcat 5.5.17. I would like to
>> persist the messages to a Postgres database rather than the default
>> apache-derby database.
>>
>> What additional config parameters do I need to set in my context.xml
>> file.
>>
>>
>> TIA Peter
>>
>>
>> context.xml:
>>
>> <Context antiJARLocking="true">
>>
>>     <Resource
>>         name="jms/ConnectionFactory"
>>         auth="Container"
>>         type="org.apache.activemq.ActiveMQConnectionFactory"
>>         description="JMS Connection Factory"
>>         factory="org.apache.activemq.jndi.JNDIReferenceFactory"
>>         brokerURL="vm://localhost"
>>         brokerName="LocalActiveMQBroker"
>>         useEmbeddedBroker="false"/>
>>
>>     <Resource name="jms/MyTopic"
>>         auth="Container"
>>         type="org.apache.activemq.command.ActiveMQTopic"
>>         factory="org.apache.activemq.jndi.JNDIReferenceFactory"
>>         physicalName="MY.TEST.FOO"/>
>>
>>     <Resource name="jms/MyQueue"
>>         auth="Container"
>>         type="org.apache.activemq.command.ActiveMQQueue"
>>         factory="org.apache.activemq.jndi.JNDIReferenceFactory"
>>         physicalName="MY.TEST.BAR"/>
>>
>> </Context>
>>
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Postgres-persistence-in-Tomcat-tf2225497.html#a6186145
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message