activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Co <...@exist.com>
Subject Re: Postgres persistence in Tomcat
Date Fri, 08 Sep 2006 06:29:55 GMT
AFAIK, ActiveMQ will create the database and tables it needs. Are you 
encountering any exceptions?

petera wrote:
> 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>
>>>
>>>
>>>   
>>>       
>>
>>     
>
>   


Mime
View raw message