Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 90392 invoked from network); 4 Nov 2010 08:31:23 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Nov 2010 08:31:23 -0000 Received: (qmail 46793 invoked by uid 500); 4 Nov 2010 08:31:54 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 46494 invoked by uid 500); 4 Nov 2010 08:31:52 -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 46485 invoked by uid 99); 4 Nov 2010 08:31:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Nov 2010 08:31:52 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS,TVD_FW_GRAPHIC_NAME_MID X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rafal.janik@softwaremind.pl designates 62.233.162.146 as permitted sender) Received: from [62.233.162.146] (HELO mail.softwaremind.pl) (62.233.162.146) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Nov 2010 08:31:47 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.softwaremind.pl (Postfix) with ESMTP id 08F6169609B for ; Thu, 4 Nov 2010 09:31:25 +0100 (CET) X-Virus-Scanned: amavisd-new at softwaremind.pl Received: from mail.softwaremind.pl ([127.0.0.1]) by localhost (mail.softwaremind.pl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uEgFIKTAEb7U for ; Thu, 4 Nov 2010 09:31:24 +0100 (CET) Received: from [10.1.1.79] (ldap.softwaremind.pl [62.233.162.148]) by mail.softwaremind.pl (Postfix) with ESMTP id 6E546695F02 for ; Thu, 4 Nov 2010 09:31:16 +0100 (CET) Message-ID: <4CD26F54.7000903@softwaremind.pl> Date: Thu, 04 Nov 2010 09:31:16 +0100 From: Rafal Janik User-Agent: Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: Ambiguous method invocations in bean binding References: <4CD175D6.9000205@softwaremind.pl> <4CD26A4F.9020500@softwaremind.pl> In-Reply-To: Content-Type: multipart/alternative; boundary="------------090904090109080203020402" --------------090904090109080203020402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Thanks a lot, I'm using camel in fuse 4.2.0. In version 4.3 there is camel 2.4(.0-fuse) so i will check it. regards, rafal > > > On Thu, Nov 4, 2010 at 9:09 AM, Rafal Janik > > wrote: > > Hi, > > thanks a lot for all answers! > > Sorry Christian, I forgot about it: > > camel-core (2.2.0) > activemq-camel (5.3.0) > jdk 1.6.0.21 > > > > > > Camel 2.4 and 2.5 is much better at picking among ambiguous methods. > So please consider upgrading. > > regards > > rafal > > > > > >> On Thu, Nov 4, 2010 at 12:28 AM, Christian M�ller >> wrote: >> >>> Hello Rafal! >>> >>> Please provide more details like the Camel version you are using in further >>> questions. Please have a look here: >>> http://camel.apache.org/how-can-i-get-help.html >>> >>> However, I assume you have a String as payload in your message. The default >>> Camel type converter mechanism is able to convert this payload also into an >>> InputStream. This is the reason, why this is ambiguous for Camel... >>> >>> I wondering, if we SHOULD make Camel a bit smarter here. I made a patch >>> which fixes this issue. We check whether the message payload is an instance >>> of the bean method argument. If so, we will use this method and don't >>> convert the body. Any objections? >>> >>> >> Camel already has this logic. Its just that the payload most likely >> isn't neither an InputStream type or a String type. >> And the payload is both convertable to InputStream and String. Hence >> Camel don't know which type your prefer. >> >> What we should maybe allow is to end user to specify that >> >> .to("bean:foo?method=methodA&type=java.io.InputStream") >> >> Or like >> .to("bean:foo?method=methodA(java.io.InputStream)") >> >> >> >> >> >>> Cheers, >>> Christian >>> >>> >> > > > -- > Software Mind > > *Rafal Janik* > Software Engineer > *Software Mind S.A.* > ul. Bociana 22A > 31-231 Krakow > Poland > > Tel. +48 12 252 34 00 > Fax: +48 12 252 34 01 > Mobile:+48 668 483 613 > rafal.janik@softwaremind.pl > www.softwaremind.pl > > This email may contain confidential and privileged material for > the sole use of the intended recipient(s). Any review, use, > retention, distribution or disclosure by others is strictly > prohibited. If you are not the intended recipient (or authorized > to receive for the recipient), please contact the sender by reply > email and delete all copies of this message. Also, email is > susceptible to data corruption, interception, tampering, > unauthorized amendment and viruses. We only send and receive > emails on the basis that we are not liable for any such > corruption, interception, tampering, amendment or viruses or any > consequence thereof. > > > > > -- > Claus Ibsen > ----------------- > FuseSource > Email: cibsen@fusesource.com > Web: http://fusesource.com > Twitter: davsclaus > Blog: http://davsclaus.blogspot.com/ > Author of Camel in Action: http://www.manning.com/ibsen/ > > -- Software Mind *Rafal Janik* Software Engineer *Software Mind S.A.* ul. Bociana 22A 31-231 Krakow Poland Tel. +48 12 252 34 00 Fax: +48 12 252 34 01 Mobile:+48 668 483 613 rafal.janik@softwaremind.pl www.softwaremind.pl This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. --------------090904090109080203020402 Content-Type: multipart/related; boundary="------------060105000406010904030105" --------------060105000406010904030105 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks a lot,
I'm using camel in fuse 4.2.0.
In version 4.3 there is camel 2.4(.0-fuse) so i will check it.
regards,
rafal


On Thu, Nov 4, 2010 at 9:09 AM, Rafal Janik <rafal.janik@softwaremind.pl> wrote:
Hi,

thanks a lot for all answers!

Sorry Christian, I forgot about it:
camel-core (2.2.0)
activemq-camel (5.3.0)
jdk 1.6.0.21
    
 


Camel 2.4 and 2.5 is much better at picking among ambiguous methods. So please consider upgrading.

 
regards
rafal


    

On Thu, Nov 4, 2010 at 12:28 AM, Christian Müller
<christian.mueller@gmail.com> wrote:
  
Hello Rafal!

Please provide more details like the Camel version you are using in further
questions. Please have a look here:
http://camel.apache.org/how-can-i-get-help.html

However, I assume you have a String as payload in your message. The default
Camel type converter mechanism is able to convert this payload also into an
InputStream. This is the reason, why this is ambiguous for Camel...

I wondering, if we SHOULD make Camel a bit smarter here. I made a patch
which fixes this issue. We check whether the message payload is an instance
of the bean method argument. If so, we will use this method and don't
convert the body. Any objections?

    
Camel already has this logic. Its just that the payload most likely
isn't neither an InputStream type or a String type.
And the payload is both convertable to InputStream and String. Hence
Camel don't know which type your prefer.

What we should maybe allow is to end user to specify that

.to("bean:foo?method=methodA&type=java.io.InputStream")

Or like
.to("bean:foo?method=methodA(java.io.InputStream)")




  
Cheers,
Christian

    
  


--
Software Mind

Rafal Janik
Software Engineer
Software Mind S.A.
ul. Bociana 22A
31-231 Krakow
Poland

Tel. +48 12 252 34 00
Fax: +48 12 252 34 01
Mobile:+48 668 483 613
rafal.janik@softwaremind.pl
www.softwaremind.pl

This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof.



--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/




--
This email may contain confident
Software Mind

Rafal Janik
Software Engineer
Software Mind S.A.
ul. Bociana 22A
31-231 Krakow
Poland

Tel. +48 12 252 34 00
Fax: +48 12 252 34 01
Mobile:+48 668 483 613
rafal.janik@softwaremind.pl
www.softwaremind.pl

This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof.
--------------060105000406010904030105 Content-Type: image/gif; name="minism.gif" Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: attachment; filename="minism.gif" R0lGODlhjQA6APcAAP+oCdjY2La2tvHx8f+1LMzF+NTU1Pn4/sDAwKGhoeHd+//y2SoqKrq6 uoJw79bW1sfHx//57by8vGBgYB0dHeTk5PXz/v+yJKysrEBAQBAQEP+sFVVVVf7+/uHh4TAw MP+tGIWFhf+9RaioqP+8QaampllZWf+2Mf/x1Xh4eP/doP/nuqqe9Dk5Obi4uEZGRv+/Sv+l AH5+flBQUOvr6wQEBP/Pdv/ty5aWli0tLZOTk2hoaKqqqlNTUw0NDf/04a2h9CYmJv+pDZmZ md3Z+9LS0pKSkv/9+ZCA8f/HYcrKynp6ehgYGHV1daKiooBt7yAgIGZmZkpKSpCQkFxcXIqK isLCwp2P8pubm//ovk1NTQgICIKCgoRz7xoaGv/dnkhISP/89kJCQnx8fP/GXf/CUX9s7nZ2 dv+rEZiK8v+nBr61905OThUVFf/ATY5+8P+5Of+mAv/79Y2NjRQUFKGT8+3q/YiIiG5ubujk /DY2Nl5eXv/pwj4+Pv/ltWtrazQ0NNzX+trV+mRkZKaa9P/UhP/Rfv/DVLmv9mxsbGJiYjw8 POfj/JeI8t/a+//hq9TO+f/JZiMjI/+4N5KD8Yp58L+/v4CAgN/f3+/v75+fn8/Pz3to7q+v r4+Pj3BwcPr6+snJyfv7+/b29rGxsbS0tMTExOjo6PLy8tra2unp6dvb2/z8/P39/ff3952d nfPz8+fn5+zs7Pj4+OPj4/X19bOzs+bm5u3t7bCwsN3d3X1q7s3Nzd7e3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F4g mLAEnDCResKfniCZsMTiNwEn2gtE9hLWgN0z4QnF373zdk99JmKfxk0A3/h/m8AnMIH8h/V+ ExoQPupVPxBMZMATrP8b8z+giU3omfWZ2IT/7S1x94cA/hOdGPwHCj+DT+heE32HAt8/8IlN ZOASHwC+J6BwCShYQgNwAgXMBwWfkAETYH2Fhwkf0HeDpwmDJxD+8AkzwH8zMAPgdXiDp3wF +H8S2Hd+p4Az8FAd+A/w139p5GSkV3cToAmeoAEpCF4sCAUzYH2k93gN4Q9xZwkZoAmXgAlQ QHgA6IL9ZwlQIGH0dwn3h1U/+A/+sAmtVHj/oAEStoKagH4W+AHe94MfoGd210qg9w+g1wkf cAlbJIZk6A9QOAGXwFf/gIWaMAH/0AkzUHhk6H8P84MA2IabIIdRCCdYOAGe0F19NwEP6BD+ 0IM6mAGY8IZgqHj5/yd7mKB7TCh7r0eGdreDcieHOigQAvgJPLiGkugPozcQVfgPlngJozcB lEgqlMiHJCiAD6N7K2iKl2AJj0h9cXiAT6h7n4B9u6iHlecJuAcRTfR/cDiLn7CGUMB5dGeB lVeLgSgQmpB/yucJM2CLPagBefeDt6R4tmiErTQQs6h4lSd7H9AJpmeL6GgJpKIJdAeLYIiF sJh/QMWMA4GKm+B/hBiMRGgJhAiFpniNmsCFDnEJEuZ4emZ7A/k3ZJh6ncd7tbh5+NcJvOeO esaOkWeKpggnnlB35EiKeraG6XR7qAgn7OgJwweNETkQHdl5H9iQIEmCLWl3a8iCpreIpCN4 CZInF/AIEV/4dluRCYUIEQcIlEZ5lEiZlEq5lEzZlNMREAA7 --------------060105000406010904030105-- --------------090904090109080203020402--