Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 12104 invoked from network); 4 Feb 2008 13:31:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Feb 2008 13:31:22 -0000 Received: (qmail 73760 invoked by uid 500); 4 Feb 2008 13:31:14 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 73738 invoked by uid 500); 4 Feb 2008 13:31:14 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 73729 invoked by uid 99); 4 Feb 2008 13:31:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2008 05:31:14 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of james.strachan@gmail.com designates 209.85.162.176 as permitted sender) Received: from [209.85.162.176] (HELO el-out-1112.google.com) (209.85.162.176) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2008 13:30:44 +0000 Received: by el-out-1112.google.com with SMTP id j27so532299elf.0 for ; Mon, 04 Feb 2008 05:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=kBN+F5UYRjT1iZRfhgrzBqW6OAje5bNKh8K0H1/PhVw=; b=gkqQQrVyD4wGbzcxXiP8NOiP+0QiK90/W7FeTs49aprlYkgS43AruplcGCu2mdYIybZPG23P6yV/aWat0pzUnqaMCJ8VfPaLldvJ7YxZXFv5jNhNphSRB2X7DBFD1cJ61agW2Czc8TefFaN4BgOC2epUeYonO5hzQIeGVw94Lmw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uLONqrd+X7TqZsJVqvxCz520YrAKzpKaBlqDfTOZeThebTuXTJ9QTAKQEzZDCdUFoa0ADc8gGdXKtaB52i6QmsWtm8mn2xktqjEsuU09acy1B+vbnEVyY699eBTOcWdreToNnEiqc3YiC339nlrQj9VJneeJSfW5n46XO9/Zlvs= Received: by 10.150.134.7 with SMTP id h7mr2953630ybd.97.1202131850328; Mon, 04 Feb 2008 05:30:50 -0800 (PST) Received: by 10.150.148.20 with HTTP; Mon, 4 Feb 2008 05:30:50 -0800 (PST) Message-ID: Date: Mon, 4 Feb 2008 13:30:50 +0000 From: "James Strachan" To: camel-user@activemq.apache.org Subject: Re: JdbcEndpoint - Consumer In-Reply-To: <15183848.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <15183848.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org On 30/01/2008, cmdr wrote: > > It not possible to create a consumer from a jdbcEndPoint. > > public Consumer 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