Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 99347 invoked from network); 13 Jan 2010 05:44:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jan 2010 05:44:13 -0000 Received: (qmail 21193 invoked by uid 500); 13 Jan 2010 05:44:13 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 21063 invoked by uid 500); 13 Jan 2010 05:44:12 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 21053 invoked by uid 99); 13 Jan 2010 05:44:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2010 05:44:12 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.218.211 as permitted sender) Received: from [209.85.218.211] (HELO mail-bw0-f211.google.com) (209.85.218.211) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2010 05:44:01 +0000 Received: by bwz3 with SMTP id 3so18281164bwz.36 for ; Tue, 12 Jan 2010 21:43:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=IOIqM7t0cqHNHRfkwpOkO+W+i9zb5arqbutMPxC6qYI=; b=S0LurGb8qAuLiiRhn9Kh3EWASJJO4+9NRpd0mMO+8e5ibGMjlCjt/37i38Ee3sT13v VxGCZG9kv2/avDdzTZhRIZLnpSg6XAyWHvK+Hjfa05+SdPmY6+gloJU4nftFM5WX3pVB PBg0WJ1hSmi3Nzk+nYZKT3d68Y0pwMla9U9VE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=OZxYujE7xzwaPOHjWY7y/ZscslQ3XVAtn1dZ/I/wKZxcWbVIGQa4uvNgc4Yehy871v oxQSz6VuYDsPQfDEKOhIFIq7Vgn7mOSQpzekk0EIDMX730KnuWTAew6ylZudrbYcz6H9 8UkGsFh8Dw6/lGzyuEcg1b9Wzsp10g9oJVYf4= MIME-Version: 1.0 Received: by 10.204.32.140 with SMTP id c12mr3198415bkd.59.1263361421161; Tue, 12 Jan 2010 21:43:41 -0800 (PST) In-Reply-To: <27136815.post@talk.nabble.com> References: <27026756.post@talk.nabble.com> <4B43F916.20108@gmail.com> <5380c69c1001052112i74cd812di22c14f365b3587c7@mail.gmail.com> <5380c69c1001070552q1bb4fd47u6c24130e0c5ad53f@mail.gmail.com> <27081298.post@talk.nabble.com> <27136815.post@talk.nabble.com> From: Claus Ibsen Date: Wed, 13 Jan 2010 06:43:21 +0100 Message-ID: <5380c69c1001122143q4113a4csa57f0aa781bb2ebf@mail.gmail.com> Subject: Re: camel-cache: Using Objects for cache To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Jan 13, 2010 at 12:32 AM, tide08 wrote: > > Looks like Ashwin got on to this before I could submit mine. > > BTW..what version of ehCache does it use? It is not very clear from pom (= and > osgi is new to me) > Check the parent/pm.xml which have versions listed. Otherwise do a mvn dependency:list in the component to see which versions maven report. [INFO] net.sourceforge.ehcache:com.springsource.net.sf.ehcache:jar:1.6.2= :compile > Thanks! > > > tide08 wrote: >> >> Thanks! I will reply back when patch is ready. >> >> >> >> Claus Ibsen-2 wrote: >>> >>> Hi >>> >>> I created a ticket for it >>> https://issues.apache.org/activemq/browse/CAMEL-2343 >>> >>> On Wed, Jan 6, 2010 at 6:12 AM, Claus Ibsen >>> wrote: >>>> On Wed, Jan 6, 2010 at 3:44 AM, Willem Jiang >>>> wrote: >>>>> I think we can support the InputStream and Serializable object at the >>>>> same >>>>> time :) >>>>> If the Message body is Serializable, we can skip the InputStream part= , >>>>> if >>>>> it's not, we can try to turn it into an InputStream. >>>>> >>>>> Any thought? >>>>> >>>> >>>> Yeah my thought as well about the Serializable >>>> >>>> >>>>> BTW, any kind of contribution is welcome, so please feel free to subm= it >>>>> the >>>>> patch with a JIRA[1]. >>>>> >>>>> [1] http://issues.apache.org/activemq/browse/CAMEL >>>>> >>>>> Willem >>>>> >>>>> >>>>> tide08 wrote: >>>>>> >>>>>> I am using camel 2.1.0 cache component, and I am confused how I can >>>>>> use >>>>>> custom objects with cache? >>>>>> >>>>>> It seems to me that for every object I would want to use, I will hav= e >>>>>> to >>>>>> register TypeConverter for those classes? Is that assumption correct= ? >>>>>> I think it is due to following code in CacheProducer.java, which tri= es >>>>>> to >>>>>> convert payload into InputStream? >>>>>> >>>>>> InputStream is =3D >>>>>> exchange.getContext().getTypeConverter().convertTo(InputStream.class= , >>>>>> body); >>>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// Read InputStream into a byte[] buf= fer >>>>>> =A0 =A0 =A0 =A0byte[] buffer =3D new byte[is.available()]; >>>>>> =A0 =A0 =A0 =A0int n =3D is.available(); >>>>>> =A0 =A0 =A0 =A0for (int j =3D 0; j < n; j++) { >>>>>> =A0 =A0 =A0 =A0 =A0 =A0buffer[j] =3D (byte)is.read(); >>>>>> =A0 =A0 =A0 =A0} >>>>>> Looking at EHCache API, it can support any object as long as it is >>>>>> serializable, so camel-cache component should not try to convert >>>>>> payload >>>>>> into InputStream. Or was there any specific reason to do so? >>>>>> >>>>>> I quickly modified Producer and it seems to work fine, please let me >>>>>> know >>>>>> and I would be happy to provide the patch. >>>>>> >>>>>> Thanks! >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Claus Ibsen >>>> Apache Camel Committer >>>> >>>> Author of Camel in Action: http://www.manning.com/ibsen/ >>>> Open Source Integration: http://fusesource.com >>>> Blog: http://davsclaus.blogspot.com/ >>>> Twitter: http://twitter.com/davsclaus >>>> >>> >>> >>> >>> -- >>> Claus Ibsen >>> Apache Camel Committer >>> >>> Author of Camel in Action: http://www.manning.com/ibsen/ >>> Open Source Integration: http://fusesource.com >>> Blog: http://davsclaus.blogspot.com/ >>> Twitter: http://twitter.com/davsclaus >>> >>> >> >> > > -- > View this message in context: http://old.nabble.com/camel-cache%3A-Using-= Objects-for-cache-tp27026756p27136815.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > --=20 Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus