Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 58517 invoked from network); 18 Jun 2009 09:22:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Jun 2009 09:22:11 -0000 Received: (qmail 75974 invoked by uid 500); 18 Jun 2009 09:22:22 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 75926 invoked by uid 500); 18 Jun 2009 09:22:22 -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 75916 invoked by uid 99); 18 Jun 2009 09:22:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2009 09:22:22 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cmoulliard@gmail.com designates 209.85.220.207 as permitted sender) Received: from [209.85.220.207] (HELO mail-fx0-f207.google.com) (209.85.220.207) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2009 09:22:12 +0000 Received: by fxm3 with SMTP id 3so845046fxm.20 for ; Thu, 18 Jun 2009 02:21:50 -0700 (PDT) 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 :date:message-id:subject:from:to:content-type; bh=7YA3RE6g+cOrUy/lCA/YYCZzl20vkFJnqqhL0rsyTNM=; b=tM4Anz5FtfgesQj6nme66mNEoJPi7ThX7i5HXhxBTLJlul3kSbzbqGQiK7nT84/zmN AJU6/qOr8rHxE4OMSNVZGjNM8ttaGB1klXAJXavUNg/+I482WghQnRNkqyRXyVMwmkXm o/HKT29xRuRZ0+uMvWjiuzV9NtffPSSG8j2hc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kFDuQQyHGKtUyfi7F2oGQIP95O2JEoT/UCRrdKF7O6EpeLulIBPc8TCcy5jul61t+m 8yZqYiT3HvYHEKhcPSO51odw50TCvYj87k4qoGh780couDjrCgC1eUZSJD5R+cc7f8+v 31vly0gQ13/PEe+D0ro+T40iP100ORiXkjNjI= MIME-Version: 1.0 Received: by 10.103.220.18 with SMTP id x18mr899384muq.24.1245316910040; Thu, 18 Jun 2009 02:21:50 -0700 (PDT) In-Reply-To: <5380c69c0906180141n229bfe9ag352ef7c96510b366@mail.gmail.com> References: <5380c69c0906180141n229bfe9ag352ef7c96510b366@mail.gmail.com> Date: Thu, 18 Jun 2009 11:21:50 +0200 Message-ID: Subject: Re: Can I call umarshall/marshall process/endpoint from a camel bean ? From: Charles Moulliard To: users@camel.apache.org Content-Type: multipart/alternative; boundary=0016e6de005e0e4a41046c9bf09f X-Virus-Checked: Checked by ClamAV on apache.org --0016e6de005e0e4a41046c9bf09f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit This is what I have done but unfortunately, Exchange is a required parameter in both methods of DataFormat ( http://camel.apache.org/maven/camel-core/apidocs/org/apache/camel/model/dataformat/DataFormatType.html ): void *marshal *(Exchange exchange, Object graph, OutputStream stream) Marshals the object to the given Stream. Object *unmarshal *(Exchange exchange, InputStream stream) Unmarshals the given stream into an object. On Thu, Jun 18, 2009 at 10:41 AM, Claus Ibsen wrote: > Hi > The Data Format abstraction in Camel is a thin layer. So you could create > your own POJO layer you can invoke. > And in the impl of the POJO layer you more or less do the same as Camel > does, but without the Exchange as parameter. > > > > On Thu, Jun 18, 2009 at 9:58 AM, Charles Moulliard >wrote: > > > Hi, > > > > I would like to know if it is possible for a camel bean to call an > > unmarshall/marshall endpoint/process (I don't know if it must be > > considerate > > as an endpoint or process) from a Camel bean ? > > > > In a normal routing, we call unmarshall/marshall like this : > > > > > > > > > > > > > > > > What I would like to do is to declare marshal/unmarshal in a spring > > DSL file (if it possible) and call it inside a bean ? > > Why, because the payload to be marshalled/unmarshalled is part of an > > object and I would like to keep this object during the pipeline route. > > > > ex > > > > > > > > // The Request > > object is an object used by Hibernate and will contain the content of > > the file. So this object cannot be unmarshalled/marshalled by its > > content well > > // Method who will > > call the unmarshall/marshall endpoint / process defined in Spring DSL > > file. This method send the string content to the endpoint > > who will unmarshall by example the content into a collection of > > Objects. The result is saved into the object Request > > > > > > because it is not possible to do this without loosing the Request object > > > > > > > > > > > > > > > > > > Regards, > > > > Charles Moulliard > > Senior Enterprise Architect > > Apache Camel Committer > > > > ***************************** > > blog : http://cmoulliard.blogspot.com > > > > > > -- > Claus Ibsen > Apache Camel Committer > > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > --0016e6de005e0e4a41046c9bf09f--