On Sat, Sep 12, 2009 at 12:23 PM, M.Ismail <[email protected]> wrote: > > Hi, > Yes, I have noticed that but, my major problem now is that I have to send > the whole XML in one line and end it with CRLF (0x0D 0x0A) which is not > convenient some times. Is there a way to solve this issue? >
Only to build you own codec where you can use special logic to detect the end of data. For example see camel-hl7 which uses HL7 specific markers for start and end bytes. Its implemented as a mina codec. The source are in camel-hl7. The idea is then you do something similar but detect when the XML ends. Maybe looking for the </myEndTag> in the data received. But when you send low level data over TCP you really need to agree on the protocol with the other parties. But yeah I know often the others may not be able to adjust or adhere to e.g. send a special end byte combo to denote the end. > > > Claus Ibsen-2 wrote: >> >> Hi >> >> In 2.1-SNAPSHOT we have added options to set the textline size. You >> can take a look at that source code and create your own mina codec >> with a larger size. >> >> >> On Sat, Sep 12, 2009 at 1:08 AM, M.Ismail <[email protected]> wrote: >>> >>> Hi, >>> First of all, I'm using Camel 1.6.1 and Camel-Mina 1.6.1 and I'm >>> sending/receiving XML over TCP and I'm using a Textline based codec. I've >>> been using the Mina component for a while now but I found that there are >>> some short comings that I need to fix: >>> 1- I have to send the whole xml in one line and terminate it with CRLF >>> (0D >>> 0A) in order to send the whole XML at once. Otherwise, I will receive the >>> message line by line. >>> 2- The default buffer size for TextLineCodec is 1024 bytes which is not >>> adequate in my case. I guess that it was set for each line. I have >>> partially >>> solved this problem in this post >>> http://www.nabble.com/Mina-Buffer-size-td25136625.html but, the new limit >>> is >>> now 4096. I don't know how to increase it more than that. >>> >>> I have thought of using XMPP (Vysper) as an implementation for the >>> ProtocolCodecFactory (Custom Codec) but I wanted to get your >>> recommendation >>> first because, if I can work fine with the TextLineCodec then I don't >>> have >>> to complicate things. >>> >>> If anyone had a successful experience with Camel+Mina+XML then share it >>> please. >>> -- >>> View this message in context: >>> http://www.nabble.com/Mina-TextlineCodec-tp25409694p25409694.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> >> > > -- > View this message in context: > http://www.nabble.com/Mina-TextlineCodec-tp25409694p25413223.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
