Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 98173 invoked from network); 23 Jun 2008 09:06:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jun 2008 09:06:40 -0000 Received: (qmail 2254 invoked by uid 500); 23 Jun 2008 09:06:42 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 2233 invoked by uid 500); 23 Jun 2008 09:06:42 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 2222 invoked by uid 99); 23 Jun 2008 09:06:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jun 2008 02:06:42 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of james.strachan@gmail.com designates 64.233.184.228 as permitted sender) Received: from [64.233.184.228] (HELO wr-out-0506.google.com) (64.233.184.228) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jun 2008 09:05:51 +0000 Received: by wr-out-0506.google.com with SMTP id 50so1924867wri.2 for ; Mon, 23 Jun 2008 02:06:09 -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:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Ll1+x9mlLOYg6a/J8M/UPJ7JJ0609WIY9ZdfCHN1ecc=; b=jxuN3eOlCN2VhckrwkZYDdfdFmTikCp1Fjca/yPG3nThR+S/2bGMX0qdD+R2nXd0Fe y8N70lrozwQxya24nLA6U0VeNhedXHwMhprVPpu45zBCUnnx/qqWl2mPa3dthhKIE2Zh 8J5SvXaZTvgghrbB/nXFlf3bos9CrlqcJSYSE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=v4/UkXlIhakJbCFd0s/YrAAiG/hiULPpvpuSNIST3V2eBrPtegsNLO3kHWP9RLqJJM QbBDdy9/JJyYHT3Y2nmtEprNYQ8dxGUsR3WEB4l0rHnYSXfAbFUGLQ7WKRry01BUOyCA RP9T4iwGNoHYiZhj7kIAAWQ+PeWBNg+KNYrAM= Received: by 10.90.35.9 with SMTP id i9mr5026235agi.30.1214211969654; Mon, 23 Jun 2008 02:06:09 -0700 (PDT) Received: by 10.90.82.6 with HTTP; Mon, 23 Jun 2008 02:06:09 -0700 (PDT) Message-ID: Date: Mon, 23 Jun 2008 10:06:09 +0100 From: "James Strachan" To: camel-user@activemq.apache.org Subject: Re: working with jms In-Reply-To: <18063097.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <18026353.post@talk.nabble.com> <18026676.post@talk.nabble.com> <18063097.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Yes - StreamSource is from JAXP... Google found this btw :) http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/stream/StreamSource.html 2008/6/23 skg : > > Hi, > I applied the changes u have made and i am getting some compilation > errors.Do i need to import some package or and additional thing. The error > is > [INFO] [compiler:compile] > [INFO] Compiling 1 source file to C:\Parent\tutorial-camel-su\target\classes > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD FAILURE > [INFO] > ------------------------------------------------------------------------ > [INFO] Compilation failure > > C:\Parent\tutorial-camel-su\src\main\java\org\apache\servicemix\tutorial\camel\M > yRouteBuilder.java:[39,148] cannot find symbol > symbol: class StreamSource > > from("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jms:consumer > ").process(new Processor(){public void process(Exchange exchange) { > StreamSource > source = exchange.getIn().getBody(StreamSource.class);if (source != null) > {in.s > etBody(source.getInputStream());}}}).to("file:C:/MavenCheckSender/reports.txt"); > > > C:\Parent\tutorial-camel-su\src\main\java\org\apache\servicemix\tutorial\camel\M > yRouteBuilder.java:[39,195] cannot find symbol > symbol: class StreamSource > > from("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jms:consumer > ").process(new Processor(){public void process(Exchange exchange) { > StreamSource > source = exchange.getIn().getBody(StreamSource.class);if (source != null) > {in.s > etBody(source.getInputStream());}}}).to("file:C:/MavenCheckSender/reports.txt"); > > > C:\Parent\tutorial-camel-su\src\main\java\org\apache\servicemix\tutorial\camel\M > yRouteBuilder.java:[39,236] cannot find symbol > symbol: variable in > > from("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jms:consumer > ").process(new Processor(){public void process(Exchange exchange) { > StreamSource > source = exchange.getIn().getBody(StreamSource.class);if (source != null) > {in.s > etBody(source.getInputStream());}}}).to("file:C:/MavenCheckSender/reports.txt"); > > James.Strachan wrote: >> >> This looks like a minor bug in the out-of-the-box type converters in >> Camel... >> >> https://issues.apache.org/activemq/browse/CAMEL-624 >> >> I've just applied a patch so this will be fixed in 1.4.0. In the >> meantime you can add a processor to fix this... >> >> from(...).process( >> new Processor() { >> public void process(Exchange exchange) { >> StreamSource source = >> exchange.getIn().getBody(StreamSource.class); >> if (source != null) { >> in.setBody(source.getInputStream()); >> } >> } >> }). >> to(...) >> >> 2008/6/20 skg : >>> >>> Hi, >>> I am getting some error i am working on the third example given on >>> tutorial >>> and i replace the code in the tutorial with >>> from("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jms:consumer").to("file:C:/MavenCheckSender/reports.txt"); >>> but i am not getting any output in it and in service mix it is showing >>> at java.lang.Thread.run(Thread.java:595) >>> ERROR - DeadLetterChannel - On delivery attempt: 1 caught: >>> org.apac >>> e.camel.InvalidPayloadException: No in body available of type: >>> java.io.InputStr >>> am but has value: StringSource[>> encoding="UTF-8"?>H >>> llo saurabh!] of type: >>> org.apache.servicemix.jbi.jaxp.StringSource >>> on >>> the exchange: Exchange[FileMessage: C:\MavenCheckSender\reports.txt] >>> rg.apache.camel.InvalidPayloadException: No in body available of type: >>> java.io. >>> nputStream but has value: StringSource[>> encoding="UTF-8"?>>> ssage>Hello saurabh!] of type: >>> org.apache.servicemix.jbi.jaxp.StringS >>> urce on the exchange: Exchange[FileMessage: >>> C:\MavenCheckSender\reports.txt] >>> at >>> org.apache.camel.util.ExchangeHelper.getMandatoryInBody(ExchangeHelpe >>> .java:117) >>> at >>> org.apache.camel.component.file.FileProducer.process(FileProducer.jav >>> :71) >>> at >>> org.apache.camel.component.file.FileProducer.process(FileProducer.jav >>> :60) >>> at >>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$Processor >>> oAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44) >>> at >>> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:7 >>> ) >>> at >>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChanne >>> .java:136) >>> at >>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChanne >>> .java:86) >>> at >>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc >>> ssor.java:40) >>> at >>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp >>> r.java:44) >>> at >>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy >>> cProcessor.java:68) >>> at >>> org.apache.servicemix.camel.CamelJbiEndpoint.processInOnly(CamelJbiEn >>> point.java:64) >>> at >>> org.apache.servicemix.common.endpoints.ProviderEndpoint.process(Provi >>> erEndpoint.java:100) >>> at >>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi >>> eCycle.java:538) >>> at >>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async >>> aseLifeCycle.java:490) >>> at >>> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife >>> ycle.java:46) >>> at >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun >>> (DeliveryChannelImpl.java:610) >>> at >>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo >>> .java:172) >>> at >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j >>> va:167) >>> at >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav >>> :134) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec >>> tor.java:650) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor >>> java:675) >>> at java.lang.Thread.run(Thread.java:595) >>> >>> >>> James.Strachan wrote: >>>> >>>> 2008/6/20 skg : >>>>> >>>>> Hi, >>>>> >>>>> I worked with the example which uses jms to receive and send message to >>>>> web >>>>> services. The consumer receives the message on servicemix console but >>>>> what >>>>> if I want the message in some file or some simple java objects such as >>>>> hashmap. Can we store our message in that also. >>>> >>>> Reply soon >>>> >>>> So send to a file use the file endpoint... >>>> http://activemq.apache.org/camel/file.html >>>> >>>> e.g. >>>> >>>> from("activemq:SomeQueue").to("file://someDir"); >>>> >>>> To work with beans and hashmaps, just send the message to a bean... >>>> http://activemq.apache.org/camel/bean-integration.html >>>> >>>> -- >>>> James >>>> ------- >>>> http://macstrac.blogspot.com/ >>>> >>>> Open Source Integration >>>> http://open.iona.com >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/working-with-jms-tp18026353s22882p18026676.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >> >> >> >> -- >> James >> ------- >> http://macstrac.blogspot.com/ >> >> Open Source Integration >> http://open.iona.com >> >> > > -- > View this message in context: http://www.nabble.com/working-with-jms-tp18026353s22882p18063097.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://open.iona.com