Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 61528 invoked from network); 14 Jan 2010 19:10:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jan 2010 19:10:31 -0000 Received: (qmail 60031 invoked by uid 500); 14 Jan 2010 19:10:30 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 60002 invoked by uid 500); 14 Jan 2010 19:10:30 -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 59992 invoked by uid 99); 14 Jan 2010 19:10:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2010 19:10:30 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2010 19:10:21 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NVV4y-0003K1-H0 for users@camel.apache.org; Thu, 14 Jan 2010 11:10:00 -0800 Message-ID: <27166556.post@talk.nabble.com> Date: Thu, 14 Jan 2010 11:10:00 -0800 (PST) From: Ashwin Karpe To: users@camel.apache.org Subject: Re: camel-cache: Using Objects for cache In-Reply-To: <27148797.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: askarpe@progress.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> <5380c69c1001122143q4113a4csa57f0aa781bb2ebf@mail.gmail.com> <27148797.post@talk.nabble.com> Hi, The other request regarding exposing cache statistics is a little more involved. I have created a Jira entry for it and will try and add this feature in due course. Cheers, Ashwin... tide08 wrote: >=20 > Thanks Claus! ArtifactID says springsource is it some customized version > of ehCache we are using? Reason I am asking is that I have conflict with > hibernate and I need to exclude ehCache dependency from either one of > these. >=20 > Also, I had another suggestion for cache component: >=20 > - Clean up ehCache.xml to remove sample cache descriptions as these are > redundant, specially the one's which use distributed cache. It requires > one of the port to be open and does not work out of the box. > - Exposing cache statistics thru jmx >=20 >=20 >=20 > Claus Ibsen-2 wrote: >>=20 >> 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) >>> >>=20 >> Check the parent/pm.xml which have versions listed. >>=20 >> Otherwise do a mvn dependency:list in the component to see which >> versions maven report. >> [INFO] =20 >> net.sourceforge.ehcache:com.springsource.net.sf.ehcache:jar:1.6.2:compil= e >>=20 >>=20 >>> 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 >>>>>>> submit >>>>>>> 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 ca= n >>>>>>>> use >>>>>>>> custom objects with cache? >>>>>>>> >>>>>>>> It seems to me that for every object I would want to use, I will >>>>>>>> have >>>>>>>> to >>>>>>>> register TypeConverter for those classes? Is that assumption >>>>>>>> correct? >>>>>>>> I think it is due to following code in CacheProducer.java, which >>>>>>>> tries >>>>>>>> to >>>>>>>> convert payload into InputStream? >>>>>>>> >>>>>>>> InputStream is =3D >>>>>>>> exchange.getContext().getTypeConverter().convertTo(InputStream.cla= ss, >>>>>>>> body); >>>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0// Read Inp= utStream into a byte[] buffer >>>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0byte[] buffer =3D new byte[is.available= ()]; >>>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0int n =3D is.available(); >>>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0for (int j =3D 0; j < n; j++) { >>>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0buffer[j] =3D (byte)is.re= ad(); >>>>>>>> =C2=A0 =C2=A0 =C2=A0 =C2=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-tp27026756= p27136815.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >>=20 >>=20 >>=20 >> --=20 >> Claus Ibsen >> Apache Camel Committer >>=20 >> 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 >>=20 >>=20 >=20 >=20 ----- ---=20 Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence=20 Progress Software Corporation 14 Oak Park Drive Bedford, MA 01730 ---=20 +1-972-304-9084 (Office)=20 +1-972-971-1700 (Mobile)=20 ----=20 Blog: http://opensourceknowledge.blogspot.com/ --=20 View this message in context: http://old.nabble.com/camel-cache%3A-Using-Ob= jects-for-cache-tp27026756p27166556.html Sent from the Camel - Users mailing list archive at Nabble.com.