camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen">
Subject RE: MS SQL Message Service endpoint
Date Thu, 03 Jul 2008 05:29:16 GMT
Hi Vlad

Thanks for the investigations. Yes there could be an odd issue with the JDBC component, as
I would assume it could consume from the database = reading. 

As a work around or how to get it working, you can get an endpoint in front to kick it off.

from("timer://kickoff?delay=10000").setBody("select * from xxxx").to("jdbc:msServiceBroker").to("activemq:aspcust1");

This is from a unit test in camel-jdbc. The timer fires every 10th second and queries the
database and send the result to the mock. In your case the activemq instead.

                    setBody(constant("select * from customer")).

Notice that the result is a list of map objects, each row is a map with the columnname as
the key. From another unit test:

        // assertions of the response
        ArrayList<HashMap<String, Object>> data = out.getOut().getBody(ArrayList.class);
        assertNotNull("out body could not be converted to an ArrayList - was: "
            + out.getOut().getBody(), data);
        assertEquals(2, data.size());
        HashMap<String, Object> row = data.get(0);
        assertEquals("cust1", row.get("ID"));
        assertEquals("jstrachan", row.get("NAME"));
        row = data.get(1);
        assertEquals("cust2", row.get("ID"));
        assertEquals("nsandhu", row.get("NAME"));

Med venlig hilsen
Claus Ibsen
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576

-----Original Message-----
From: Vadim Chekan [] 
Sent: 3. juli 2008 01:33
Subject: Re: MS SQL Message Service endpoint

Ok, I got this one. My ActiveMQ installation does not contain camel-jdbc.jar.
It runs fine now but it gives me "Failed to execute main task. Reason:
Copied spring-aop-2.5.1.jar

Ok, now:
Caused by: org.apache.camel.RuntimeCamelException: A JDBC Consumer would be the
server side of database! No such support here at

Hmm, I remember seeing this exception in the source code but I do not
understand it. why <from uri="jdbc:msServiceBroker" /> tries to create
a consumer. I thought that "from" is a message producer, right?

On Wed, Jul 2, 2008 at 12:33 PM, Vadim Chekan <> wrote:
> Here is my progress:
> First of all it complained about DriverManagerDataSource class so I've
> downloaded spring-jdbc-2.5.1.jar and put it to lib/optional
> Now I'm getting
> =======================================
> Caused by: org.apache.camel.NoSuchEndpointException: No endpoint could be found
> for: jdbc:msServiceBroker
>        at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelCo
> =======================================
> My configuration is:
> ===============================================================
>   <camelContext id="camel"
> xmlns="">
>           <route>
>                   <from uri="jdbc:msServiceBroker" />
>                   <to uri="activemq:aspcust1" />
>           </route>
>   </camelContext>
>        <bean id="msServiceBroker"
> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
>                <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver"/>
>                <property name="url"
> value="jdbc:jtds:sqlserver://aspcust1/LogQueue;instance=main"/>
>                <property name="username" value="****"/>
>                <property name="password" value="****"/>
>        </bean>
> ===============================================================
> I thought that it it the way this thing works: after jdbc uri you
> specify a bean, but apparently I got it wrong. I'm trying to define
> endpoint explicitly now withing camel context.
> Any help please?
> BTW: there is an error in schema location in default configuration
> file: does
> not exist. I had to change it to
> to make
> my Visual Studio hints working ;)
> --
> From RFC 2631: In ASN.1, EXPLICIT tagging is implicit unless IMPLICIT
> is explicitly specified

>From RFC 2631: In ASN.1, EXPLICIT tagging is implicit unless IMPLICIT
is explicitly specified

View raw message