camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: JdbcEndpoint - Consumer
Date Mon, 04 Feb 2008 13:30:50 GMT
On 30/01/2008, cmdr <spcmdr@yahoo.fr> wrote:
>
> It not possible to create a consumer from a jdbcEndPoint.
>
> public Consumer<DefaultExchange> createConsumer(Processor processor) throws
> Exception
> {
>     throw new RuntimeCamelException("A JDBC Consumer would be the server
> side of database! No such support here");
> }
>
> What is the best pratice to get data from database and send them as messages
> ?:confused:

So the JDBC component basically assumes the body of the message is the
SQL to execute.

If you want to query/poll a database and send messages on you could
use the JPA component...
http://activemq.apache.org/camel/jpa.html

which does exactly that. The idea is you write a JPA entity bean for
the table you want to poll; then when the message is processed, the
row is deleted. (You can use queries and update the entity when its
finished if you prefer).

Another option if you are more comfortable with iBatis than
hibernate/openjpa/toplink is to use the ibatis component...
http://activemq.apache.org/camel/ibatis.html

in both cases the idea is generally to make a bean to represent a row.

We could write an SDO component and use that to avoid the user having
to write a bean...

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message