Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 19367 invoked from network); 3 Mar 2010 18:32:01 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Mar 2010 18:32:01 -0000 Received: (qmail 85728 invoked by uid 500); 3 Mar 2010 18:31:53 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 85629 invoked by uid 500); 3 Mar 2010 18:31:53 -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 85621 invoked by uid 99); 3 Mar 2010 18:31:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Mar 2010 18:31:53 +0000 X-ASF-Spam-Status: No, hits=3.5 required=10.0 tests=SPF_PASS,URIBL_BLACK X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of carlo.camerino@gmail.com designates 209.85.222.193 as permitted sender) Received: from [209.85.222.193] (HELO mail-pz0-f193.google.com) (209.85.222.193) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Mar 2010 18:31:43 +0000 Received: by pzk31 with SMTP id 31so1162570pzk.20 for ; Wed, 03 Mar 2010 10:31:23 -0800 (PST) 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 :content-transfer-encoding; bh=zst0EeM08+mg2vwmB3JgA2cjgMNqbUWZXkfbnB9rQ5U=; b=cd4RFIlLi8zBNsqCeqiPdKlHK9z5Nw9qrO99dE61InQnMybJn8Pd0Smt++MUpD63AD 2icNzSXx7rCkv9w68lMp4U6EjDN7Gwo0w+1XXuk4CN/BazOgf806K3wmDwHbCRU9Q3ot /XAcVV2vhzUemK6MLCwfMJwK9Miwu2r+2tO0U= 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:content-transfer-encoding; b=W7z+90gsfV59wx7VEw0RJasNCnnuPbF9Lx2hUOhw81L4GQiVx5czDWHqiVKr7oO6qf BzNL5pclIEF/kGL0nEsXmbkUT58vYmdM8HwzRvniWabZOfesJNO2ogpn8Eei3egyLfPr kGRHfof23TV+ARzbI7OnLN6K/NT7L1zxNX9bE= MIME-Version: 1.0 Received: by 10.142.61.36 with SMTP id j36mr4556438wfa.322.1267641082863; Wed, 03 Mar 2010 10:31:22 -0800 (PST) In-Reply-To: <27771764.post@talk.nabble.com> References: <3fee29161003020629j55ad36fbo66f8a61da04b755f@mail.gmail.com> <5380c69c1003020743nb671900rac9012b4567e197e@mail.gmail.com> <3fee29161003021100p1ff8708el38b5938c7242979f@mail.gmail.com> <27761139.post@talk.nabble.com> <3fee29161003030759o125f23eev8ab7a052f15ad9bd@mail.gmail.com> <27771764.post@talk.nabble.com> Date: Thu, 4 Mar 2010 02:31:22 +0800 Message-ID: <3fee29161003031031t49fcd217oe99e2219fc470bfe@mail.gmail.com> Subject: Re: Question On Camel Mina - Multiple Messages With One IOSession From: Carlo Camerino To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable i used sync =3Dtrue, i'm still got replies from another thread.... On Thu, Mar 4, 2010 at 2:20 AM, anandsk wrote: > > when you use from it becomes the consumer and listens on that port if you= r > app is running on host. > > If you are trying to identify the corresponding reply to a request, I > beleive you need to have something in message to identify it uniquely. ot= her > alternative is using synchronus request/reply by setting sync flag to tru= e. > > Thanks, > Anand > > > > carlo c wrote: >> >> i was able to use codec successfully, >> >> however, i am having problems with the replies, >> >> sometimes i get the reply of another thread using the camel mina >> component. >> >> how do i ensure that i am getting the proper reply >> >> i used the following >> >> mina:tcp://host:port?codec=3D#codecFactory >> >> how can i ensure that the reply is for me? >> >> what i did was to limit the number of consumers to 1 however i don't >> wnt to do this in the future, >> >> the alternative that i could think is to set a separate >> >> from("mina:tcp://host:port?codec=3D#codecFactory") thread, is this the >> correct way to handle this =A0and set sync to false.... >> >> On Wed, Mar 3, 2010 at 5:04 AM, anandsk wrote: >>> >>> If I understand your question correctly, you may want to look at codec >>> option >>> of camel-mina component. >>> >>> Thanks, >>> Anand >>> >>> >>> carlo c wrote: >>>> >>>> hi there, >>>> >>>> thanks a lot!! >>>> i'm trying to understand the code in camel-mina and it seems that you >>>> can configure it to signify that it is a textline? correct? >>>> but what if the message returning isn't a text line. >>>> In our case for example, the sample code that i use is >>>> >>>> dis.available() to determine if a message arrived, >>>> afterwards, i configure a new byte[] in order to be able to read the >>>> message >>>> >>>> Here is my source code using native java.io api >>>> // input stream declaration coming from Socket >>>> DataInputStream dis =3D **/ >>>> // i'm checking this method (dis.available()) --> this returns the >>>> number of bytes that an incoming message contains >>>> byte[] responseByte =3D new byte[dis.available()]; >>>> // >>>> dis.readFully(responseByte); >>>> >>>> i somehow do it like this, >>>> is there anyway that i can do this in camel mina? >>>> =A0i need to be able to get a response via the size of the input strea= m >>>> coming back. >>>> >>>> thanks >>>> carlo >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://old.nabble.com/Question-On-Camel-Mina---Multiple-Messages-With-O= ne-IOSession-tp27756509p27761139.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >> >> > > -- > View this message in context: http://old.nabble.com/Question-On-Camel-Min= a---Multiple-Messages-With-One-IOSession-tp27756509p27771764.html > Sent from the Camel - Users mailing list archive at Nabble.com. > >