activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Gunther <jeff.gunt...@intalgent.com>
Subject Re: [camel] Spring and Custom Components
Date Sat, 12 May 2007 04:36:26 GMT
On May 11, 2007, at 11:16 PM, James Strachan wrote:

> On 5/10/07, Jeff Gunther <jeff.gunther@intalgent.com> wrote:
>> Hi James,
>>
>> Thank you for the very detailed follow up! That worked wonderfully.
>
> Great! Just out of interest, do you fancy contributing your  
> component :)

Sure. What's the best method to send you the component?

>> Related to this issue, how would I set the ConnectionFactory for the
>> JMS Component?
>
> Here's an example that shows you how to do it in Java code...
> http://activemq.apache.org/camel/walk-through-an-example.html
>
> Also I've just updated the wiki to show how to do the same thing via
> Spring XML also (you might need to hit refresh on your browser)
> http://cwiki.apache.org/CAMEL/how-do-i-add-a-component.html
> http://cwiki.apache.org/CAMEL/how-do-i-configure-endpoints.html

 From my testing, it appears that the modification you made to the  
JmsComponent starts it's own broker. Is this accurate? If so, how can  
I connect to a standalone broker or how can I configure the  
JmsComponent to use an ActiveMQ persistence adapter and MySQL data- 
source?

Currently, I'm using the following Spring configuration to use a  
ActiveMQ persistence adapter and a MySQL data-source:

	<bean id="broker" class="org.apache.activemq.broker.BrokerService"  
init-method="start" destroy-method="stop">
		<property name="brokerName" value = "broker"/>
		<property name="persistent" value="true"/>
		<property name="useJmx" value = "false"/>
		<property name="transportConnectorURIs">
			<list>
				<value>vm://localhost</value>
				<value>tcp://localhost:9000</value>
			</list>
		</property>
		<property name="persistenceAdapter" ref="persistenceAdapter"/>
	</bean>

	<bean id="persistenceAdapter"  
class="org.apache.activemq.store.PersistenceAdapterFactoryBean">
	    <property name="dataSource" ref="mysql-ds"/>
	    <property name="dataDirectory" value="activemq-data"/>
	    <property name="journalLogFiles" value="5"/>
   	</bean>

	<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? 
relaxAutoCommit=true"/>
	    <property name="username" value="root"/>
	    <property name="password" value=""/>
	    <property name="poolPreparedStatements" value="true"/>
   	</bean>

Jeff Gunther



Mime
View raw message