camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Cable (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-4151) documentation for jdbc idempotent repository - use with spring DSL
Date Sat, 25 Jun 2011 07:22:47 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-4151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054829#comment-13054829
] 

Julian Cable commented on CAMEL-4151:
-------------------------------------

I meant to add an example route:

<route>
	<from uri="seda:in"/>
	<setHeader headerName="someHeader">
		<xpath resultType="java.lang.String">//Key</xpath>
	</setHeader>
	<doTry>
		<idempotentConsumer messageIdRepositoryRef="myRepo">
			<header>someHeader</header>
			<to uri="seda:out"/>
		</idempotentConsumer>
		<doCatch>
			<!-- I have not found the right set of exceptions to catch for this :( -->
			<exception>java.net.ConnectException</exception>
			<!-- If we can't access the repository, play safe and deliver the message -->
			<to uri="seda:out"/>
		</doCatch>
	</doTry>
</route>



> documentation for jdbc idempotent repository - use with spring DSL
> ------------------------------------------------------------------
>
>                 Key: CAMEL-4151
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4151
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-sql
>    Affects Versions: 2.7.1
>         Environment: camels on any
>            Reporter: Julian Cable
>            Assignee: Christian Müller
>              Labels: docuentation, idempotent, jdbc
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
>  I couldn't find any reference to using this with spring DSL. I came up with this which
seems to work:
> 	<bean id="myRepo" class="org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository">
> 		<constructor-arg index="0" ref="myJDBC"/>
> 		<constructor-arg index="1" value="foobar"/>
> 	</bean>
> 	<bean id="myJDBC" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> 		<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
> 		<property name="url" value="${myJDBC.uri}" />
> 		<property name="username" value="${myJDBC.username}" />
> 		<property name="password" value="${myJDBC.password}" />
> 	</bean>
> I think it would be better if the class had a default constructor and looked for properties.
> Julian

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message