Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 59855 invoked from network); 7 Sep 2010 00:07:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Sep 2010 00:07:51 -0000 Received: (qmail 69323 invoked by uid 500); 7 Sep 2010 00:07:51 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 69217 invoked by uid 500); 7 Sep 2010 00:07:50 -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 69209 invoked by uid 99); 7 Sep 2010 00:07:50 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2010 00:07:50 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of glen.mazza@gmail.com designates 209.85.216.180 as permitted sender) Received: from [209.85.216.180] (HELO mail-qy0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2010 00:07:29 +0000 Received: by qyk31 with SMTP id 31so5401543qyk.11 for ; Mon, 06 Sep 2010 17:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=6ie6w6eKGVrIEDuBrdCaJMxLDvv+qxKs0EFN3wVXlRc=; b=ZnBWblM/lcrHTNDhlOBXKshYHkR9JQQkh9l8Tup0wdRwwhwdDYX3LoNBGTa74IMY6M OmCbpYMdC10F8BG+CwGj41iI4XQfNL/y6Czgvdnue9+B6UneI0m7lIYQbJURmv/I2p4+ bo1urSXGr3gglydHLZxmcAYKb0U6kwRoZn/oM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=f8fInNH8Mx3b1PWqoLLLSN6fU+e147h/vDKcbG6dshrg9CoB9iiseaqKZtzyzsAEu2 b+99T+YV31O4zKJmsR1ovKfAM8ze5L6+GuzqI4a02Vhtqx0Nm4UAq4diDUWEWgH7UTqr r3UWbu20ng7OGri5crz2IIifMfk4p9P2WfnXs= Received: by 10.224.47.85 with SMTP id m21mr262165qaf.270.1283818028069; Mon, 06 Sep 2010 17:07:08 -0700 (PDT) Received: from [192.168.1.39] (pool-70-18-237-85.res.east.verizon.net [70.18.237.85]) by mx.google.com with ESMTPS id t1sm6292281qcs.45.2010.09.06.17.07.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 06 Sep 2010 17:07:06 -0700 (PDT) Message-ID: <4C85822D.8060702@gmail.com> Date: Mon, 06 Sep 2010 20:07:09 -0400 From: Glen Mazza User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: AW: Sending POJOs on Message Queues? References: <4C84D7D2.20301@gmail.com> <4C84D919.5000109@scanmine.com> <4C84E00A.60705@gmail.com> <4C84E112.5070207@scanmine.com> <4C84E3C2.6000009@gmail.com> <4C84F756.7040408@gmail.com> <0E608B3AEB71BF429396A5AF065ED05D09D5365010@S3Q2173.enbw.net> In-Reply-To: <0E608B3AEB71BF429396A5AF065ED05D09D5365010@S3Q2173.enbw.net> Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks, Christian. It turned out I do need to have the JAXB objects implement the Serializable marker interface (like here[1], but I didn't need toString() as it suggests) if I'm going to be sending them or reading them from a jms queue. But I don't need Serializable if I'm using the "direct" component. I'll check the soap component next. Glen [1] http://stackoverflow.com/questions/1513972/how-to-generate-a-java-class-which-implements-serializable-interface-from-xsd-usi Schneider Christian wrote: > Hi Glen, > > if you use jaxb then your classes do not have to implement Serializable. Instead they of course need to be serializeable by jaxb. > > Btw. if you want to call a webservice with the jaxb object (Seems so as you add the soap by using xslt) then you should take a look at the camel soap dataformat. http://camel.apache.org/soap.html > > > > Greetings > > Christian > > > > > > Christian Schneider > Informationsverarbeitung > Business Solutions > Handel und Dispatching > > Tel : +49-(0)721-63-15482 > > EnBW Systeme Infrastruktur Support GmbH > Sitz der Gesellschaft: Karlsruhe > Handelsregister: Amtsgericht Mannheim � HRB 108550 > Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck > Gesch�ftsf�hrer: Jochen Adenau, Hans-G�nther Meier > > > -----Urspr�ngliche Nachricht----- > Von: Glen Mazza [mailto:glen.mazza@gmail.com] > Gesendet: Montag, 6. September 2010 16:15 > An: users@camel.apache.org > Betreff: Re: Sending POJOs on Message Queues? > > But, just to confirm, do I need to make the JAXB objects serializable if > I plan on placing them on a queue or reading them from a queue? If > that's the case (makes sense), I will update the Camel JAXB page to > highlight that--it presently doesn't say anything about serializability. > > I'm trying to practice working with JAXB, e.g., > > from("jms:queue:numbersToDouble") > .marshal(jaxbFormat) > .to("xslt://AddSOAPEnvelope.xsl") > .to(CXF_URI) > > One more thing--if I needed to make the JAXB object serializable for it > to work on a queue but didn't (or couldn't) do so, what could I replace > "from("jms:queue:numbersToDouble")" above with to start the route? The > "direct" component? > > Thanks, > Glen > > > Charles Moulliard wrote: > >> Hi Glen, >> >> Using Camel, you can use marshal() or unmarshal() to transform objects --> >> XML or XML --> objects >> >> http://camel.apache.org/jaxb.html >> >> Regards, >> >> Charles Moulliard >> >> Senior Enterprise Architect (J2EE, .NET, SOA) >> Apache Camel - Karaf - ServiceMix Committer >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Blog : http://cmoulliard.blogspot.com | Twitter : >> http://twitter.com/cmoulliard >> Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype: cmoulliard >> >> >> On Mon, Sep 6, 2010 at 2:51 PM, Glen Mazza wrote: >> >> >> >>> Oh! I was thinking of sending the POJO to the queue where it would be >>> subsequently read and marshalled into XML, but I can have the client-side >>> marshal into XML and send the XML to the queue instead. Makes sense... >>> >>> Thanks again, >>> Glen >>> >>> >>> Tarjei Huse wrote: >>> >>> >>> >>>> On 09/06/2010 02:35 PM, Glen Mazza wrote: >>>> >>>> >>>> >>>> >>>>> No, it's not serializable, but I believe with some effort I can make >>>>> it so (The class is JAXB-generated to support a web service call; >>>>> JAXB has some extensions to allow for serializability). Right now I'm >>>>> trying to get the JAXB DataFormat to work (after sending the object to >>>>> the queue I plan on marshalling it to XML) just for the sake of seeing >>>>> JAXB working. >>>>> >>>>> @XmlAccessorType(XmlAccessType.FIELD) >>>>> @XmlType(name = "", propOrder = { >>>>> "numberToDouble" >>>>> }) >>>>> @XmlRootElement(name = "DoubleIt") >>>>> public class DoubleIt { >>>>> protected int numberToDouble; >>>>> ... setter and getter for above... >>>>> } >>>>> >>>>> I can look into JSON and/or Protobuf next -- is it primarily speed, or >>>>> ease-of-use (don't have to worry about making the class serializable), >>>>> or smaller message size that you recommend those other formats? >>>>> >>>>> >>>>> >>>>> >>>> In my experience using a format that is not dependent on both the client >>>> and server having the same version of the java object class makes it far >>>> easier to do updates and deployments. If you got an xml format that >>>> works that may fit the bill just fine. >>>> >>>> Another bonus is that you can use other languages to process the objects >>>> if needed. >>>> >>>> Regards, >>>> Tarjei >>>> >>>> >>>> >>>> >>>> >>>>> Thanks, >>>>> Glen >>>>> >>>>> Tarjei Huse wrote: >>>>> >>>>> >>>>> >>>>> >>>>>> Hi, >>>>>> On 09/06/2010 02:00 PM, Glen Mazza wrote: >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> Hello, I'm new to ActiveMQ messaging queues and unsure if I can place >>>>>>> and subsequently read POJO's from them. I have no problems getting >>>>>>> Strings to work it's just using POJO's that is creating the problem >>>>>>> for me. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> You should be able to send Serializable objects through the queues, but >>>>>> I would like to suggest you look into other serialization methods like >>>>>> Protobufs or JSON. >>>>>> >>>>>> Is DoubleIt serializable? >>>>>> >>>>>> Regards, >>>>>> Tarjei >>>>>> >>>>>> >>>>>> >>>>>> >>>> >>>> >>> >>> >> >> > > >