You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michael Dewitte <mi...@gmail.com> on 2011/04/01 07:39:36 UTC

Re: multiple databases used in mybatis or ibatis in one route

Thnaks to you, Claus and Richard for this fast and extensive help ! I'll
give it a try today !

Thx,

Mike



2011/3/31 Richard Kettelerij <ri...@gmail.com>

> To use this component in your route use:
>
>       from("mybatis2:selectFoo").to("...");
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/multiple-databases-used-in-mybatis-or-ibatis-in-one-route-tp4273206p4274145.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: multiple databases used in mybatis or ibatis in one route

Posted by Michael Dewitte <mi...@gmail.com>.
Hello,

thanks to Claus and Richard, it worked !

So, to further help anyone who would have the same need : I wanted to be
able to use MyBatis pointing to 2 different datasources in the same route. I
use Camel 2.7.0 on ServiceMix (trunk).

Using the spring dsl, my configuration was :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ctx="
http://www.springframework.org/schema/context"
xmlns:camel="http://camel.apache.org/schema/spring" xmlns:osgix="
http://www.springframework.org/schema/osgi-compendium"
xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
">

<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from URI="timer://SynchroDB?period=30000"/>
<to uri="mybatis:selectDataToTransfert?statementType=SelectList" />   <!--
retrieve the list of ID to synchronise -->
                        <split>
                           <simple>${body}</simple>
                           <to uri="log:events" />
                           <to
uri="mybatis:selectDataContentToTransfert?statementType=SelectOne" /> <!--
retrieve the datato transfert -->
                           <to
uri="mybatis2:registerInbound?statementType=Insert" />
                        </split>
</route>
</camel:camelContext>
    <bean id="mybatis2"
class="org.apache.camel.component.mybatis.MyBatisComponent">
       <property name="configurationUri"
value="SqlMapConfig_destination.xml"/>
    </bean>
</beans>


Hope it'll be helpfull to someone !

Mike


2011/4/1 Michael Dewitte <mi...@gmail.com>

> Thnaks to you, Claus and Richard for this fast and extensive help ! I'll
> give it a try today !
>
> Thx,
>
> Mike
>
>
>
> 2011/3/31 Richard Kettelerij <ri...@gmail.com>
>
>> To use this component in your route use:
>>
>>       from("mybatis2:selectFoo").to("...");
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/multiple-databases-used-in-mybatis-or-ibatis-in-one-route-tp4273206p4274145.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>