You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Raphaël Barazzutti <ra...@gmail.com> on 2013/05/05 01:31:39 UTC

MINA 3.0 Thrift and Protobuf support

Hi MINA-developers!

Using extensively MINA 2.0 at my work, I’d like to contribute to the next
MINA version.

IMHO, MINA 3.0 could provide serialization facilities like Apache Thrift
and Google Protobuf transport.

According to that I decide to propose the following code to be merged with
the main repository of MINA 3.0.

Please have a look to my repo : https://github.com/rbarazzutti/mina

Suggestions are welcome,

Kind regards,

Raphaël

Re: MINA 3.0 Thrift and Protobuf support

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/5/13 1:31 AM, Raphaël Barazzutti a écrit :
> Hi MINA-developers!

Hi Raphaël !
>
> Using extensively MINA 2.0 at my work, I’d like to contribute to the next
> MINA version.
>
> IMHO, MINA 3.0 could provide serialization facilities like Apache Thrift
> and Google Protobuf transport.
This is most certainly wanted...
>
> According to that I decide to propose the following code to be merged with
> the main repository of MINA 3.0.
>
> Please have a look to my repo : https://github.com/rbarazzutti/mina

Will do...

Thanks for your contribution ! Give us a bit of time to review the code.



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: MINA 3.0 Thrift and Protobuf support

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/5/13 10:44 AM, Julien Vermillard a écrit :
> Hi Raphäel
> Looks neat, I have definitively a use case for that : RPC.
>
> Perhaps we should have two maven module : one for thrift, one for
> protobuf ? This would avoid people to have thrift dependency when they
> use protobuff (and "vice versa").
Absoluty. This deserves 2 modules.
>
> I would be definitively better than the current java serialization
> codec bothering everybody on android !
The current Mina 2.0 serialization codec is a hack anyway...


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: MINA 3.0 Thrift and Protobuf support

Posted by Raphaël Barazzutti <ra...@gmail.com>.
Hi Julien,

You're right it'd a nice addition. I've some fixes to commit and then I can
focus on providing examples.

Regards,

Raphaël






On Tue, Jun 11, 2013 at 3:33 PM, Julien Vermillard <jv...@gmail.com>wrote:

> A couple of examples for those modules would be a nice addition.
> Raphael you think you can provide that ?
>
> julien
> --
> Julien Vermillard :::: http://people.apache.org/~jvermillard/
>
>
> On Thu, May 9, 2013 at 7:58 PM, Jeff MAURY <je...@gmail.com> wrote:
> > My +1
> >
> >
> > Jeff
> > —
> > Sent from Mailbox for iPhone
> >
> > On Thu, May 9, 2013 at 7:48 PM, Emmanuel Lécharny <el...@gmail.com>
> > wrote:
> >
> >> Le 5/9/13 5:17 PM, Julien Vermillard a écrit :
> >>> What do you think of having the two modules (thrift and protobuff)
> >>> dicrectly at the root of the project and not in a serialization
> >>> intermediate module ?
> >>> That would reduce pom hierarchy/maintenance.
> >> My +1
> >> --
> >> Regards,
> >> Cordialement,
> >> Emmanuel Lécharny
> >> www.iktek.com
>

Re: MINA 3.0 Thrift and Protobuf support

Posted by Julien Vermillard <jv...@gmail.com>.
A couple of examples for those modules would be a nice addition.
Raphael you think you can provide that ?

julien
--
Julien Vermillard :::: http://people.apache.org/~jvermillard/


On Thu, May 9, 2013 at 7:58 PM, Jeff MAURY <je...@gmail.com> wrote:
> My +1
>
>
> Jeff
> —
> Sent from Mailbox for iPhone
>
> On Thu, May 9, 2013 at 7:48 PM, Emmanuel Lécharny <el...@gmail.com>
> wrote:
>
>> Le 5/9/13 5:17 PM, Julien Vermillard a écrit :
>>> What do you think of having the two modules (thrift and protobuff)
>>> dicrectly at the root of the project and not in a serialization
>>> intermediate module ?
>>> That would reduce pom hierarchy/maintenance.
>> My +1
>> --
>> Regards,
>> Cordialement,
>> Emmanuel Lécharny
>> www.iktek.com

Re: MINA 3.0 Thrift and Protobuf support

Posted by Jeff MAURY <je...@gmail.com>.
My +1


Jeff
—
Sent from Mailbox for iPhone

On Thu, May 9, 2013 at 7:48 PM, Emmanuel Lécharny <el...@gmail.com>
wrote:

> Le 5/9/13 5:17 PM, Julien Vermillard a écrit :
>> What do you think of having the two modules (thrift and protobuff)
>> dicrectly at the root of the project and not in a serialization
>> intermediate module ?
>> That would reduce pom hierarchy/maintenance.
> My +1
> -- 
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com 

Re: MINA 3.0 Thrift and Protobuf support

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/9/13 5:17 PM, Julien Vermillard a écrit :
> What do you think of having the two modules (thrift and protobuff)
> dicrectly at the root of the project and not in a serialization
> intermediate module ?
> That would reduce pom hierarchy/maintenance.

My +1

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: MINA 3.0 Thrift and Protobuf support

Posted by Julien Vermillard <jv...@gmail.com>.
What do you think of having the two modules (thrift and protobuff)
dicrectly at the root of the project and not in a serialization
intermediate module ?
That would reduce pom hierarchy/maintenance.

Julien

On Tue, May 7, 2013 at 9:30 PM, Julien Vermillard <jv...@gmail.com> wrote:
> Hi,
> I just merged your repo, thanks for the contrib !
> If you have any modification to merge, ping us.
>
> Julien
>
> On Sun, May 5, 2013 at 12:18 PM, Raphaël Barazzutti
> <ra...@gmail.com> wrote:
>> Hi Julien,
>>
>> Thanks for your feedback.
>>
>> Yes, I splited that features in two sub-modules to avoid people to have
>> both dependencies (in most cases they will use only one).
>>
>> Regards,
>>
>> Raphaël
>>
>>
>> On Sun, May 5, 2013 at 10:44 AM, Julien Vermillard <jv...@gmail.com>wrote:
>>
>>> Hi Raphäel
>>> Looks neat, I have definitively a use case for that : RPC.
>>>
>>> Perhaps we should have two maven module : one for thrift, one for
>>> protobuf ? This would avoid people to have thrift dependency when they
>>> use protobuff (and "vice versa").
>>>
>>> I would be definitively better than the current java serialization
>>> codec bothering everybody on android !
>>>
>>> Julien
>>>
>>>
>>> On Sun, May 5, 2013 at 1:31 AM, Raphaël Barazzutti
>>> <ra...@gmail.com> wrote:
>>> > Hi MINA-developers!
>>> >
>>> > Using extensively MINA 2.0 at my work, I’d like to contribute to the next
>>> > MINA version.
>>> >
>>> > IMHO, MINA 3.0 could provide serialization facilities like Apache Thrift
>>> > and Google Protobuf transport.
>>> >
>>> > According to that I decide to propose the following code to be merged
>>> with
>>> > the main repository of MINA 3.0.
>>> >
>>> > Please have a look to my repo : https://github.com/rbarazzutti/mina
>>> >
>>> > Suggestions are welcome,
>>> >
>>> > Kind regards,
>>> >
>>> > Raphaël
>>>

Re: MINA 3.0 Thrift and Protobuf support

Posted by Julien Vermillard <jv...@gmail.com>.
Hi,
I just merged your repo, thanks for the contrib !
If you have any modification to merge, ping us.

Julien

On Sun, May 5, 2013 at 12:18 PM, Raphaël Barazzutti
<ra...@gmail.com> wrote:
> Hi Julien,
>
> Thanks for your feedback.
>
> Yes, I splited that features in two sub-modules to avoid people to have
> both dependencies (in most cases they will use only one).
>
> Regards,
>
> Raphaël
>
>
> On Sun, May 5, 2013 at 10:44 AM, Julien Vermillard <jv...@gmail.com>wrote:
>
>> Hi Raphäel
>> Looks neat, I have definitively a use case for that : RPC.
>>
>> Perhaps we should have two maven module : one for thrift, one for
>> protobuf ? This would avoid people to have thrift dependency when they
>> use protobuff (and "vice versa").
>>
>> I would be definitively better than the current java serialization
>> codec bothering everybody on android !
>>
>> Julien
>>
>>
>> On Sun, May 5, 2013 at 1:31 AM, Raphaël Barazzutti
>> <ra...@gmail.com> wrote:
>> > Hi MINA-developers!
>> >
>> > Using extensively MINA 2.0 at my work, I’d like to contribute to the next
>> > MINA version.
>> >
>> > IMHO, MINA 3.0 could provide serialization facilities like Apache Thrift
>> > and Google Protobuf transport.
>> >
>> > According to that I decide to propose the following code to be merged
>> with
>> > the main repository of MINA 3.0.
>> >
>> > Please have a look to my repo : https://github.com/rbarazzutti/mina
>> >
>> > Suggestions are welcome,
>> >
>> > Kind regards,
>> >
>> > Raphaël
>>

Re: MINA 3.0 Thrift and Protobuf support

Posted by Raphaël Barazzutti <ra...@gmail.com>.
Hi Julien,

Thanks for your feedback.

Yes, I splited that features in two sub-modules to avoid people to have
both dependencies (in most cases they will use only one).

Regards,

Raphaël


On Sun, May 5, 2013 at 10:44 AM, Julien Vermillard <jv...@gmail.com>wrote:

> Hi Raphäel
> Looks neat, I have definitively a use case for that : RPC.
>
> Perhaps we should have two maven module : one for thrift, one for
> protobuf ? This would avoid people to have thrift dependency when they
> use protobuff (and "vice versa").
>
> I would be definitively better than the current java serialization
> codec bothering everybody on android !
>
> Julien
>
>
> On Sun, May 5, 2013 at 1:31 AM, Raphaël Barazzutti
> <ra...@gmail.com> wrote:
> > Hi MINA-developers!
> >
> > Using extensively MINA 2.0 at my work, I’d like to contribute to the next
> > MINA version.
> >
> > IMHO, MINA 3.0 could provide serialization facilities like Apache Thrift
> > and Google Protobuf transport.
> >
> > According to that I decide to propose the following code to be merged
> with
> > the main repository of MINA 3.0.
> >
> > Please have a look to my repo : https://github.com/rbarazzutti/mina
> >
> > Suggestions are welcome,
> >
> > Kind regards,
> >
> > Raphaël
>

Re: MINA 3.0 Thrift and Protobuf support

Posted by Julien Vermillard <jv...@gmail.com>.
Hi Raphäel
Looks neat, I have definitively a use case for that : RPC.

Perhaps we should have two maven module : one for thrift, one for
protobuf ? This would avoid people to have thrift dependency when they
use protobuff (and "vice versa").

I would be definitively better than the current java serialization
codec bothering everybody on android !

Julien


On Sun, May 5, 2013 at 1:31 AM, Raphaël Barazzutti
<ra...@gmail.com> wrote:
> Hi MINA-developers!
>
> Using extensively MINA 2.0 at my work, I’d like to contribute to the next
> MINA version.
>
> IMHO, MINA 3.0 could provide serialization facilities like Apache Thrift
> and Google Protobuf transport.
>
> According to that I decide to propose the following code to be merged with
> the main repository of MINA 3.0.
>
> Please have a look to my repo : https://github.com/rbarazzutti/mina
>
> Suggestions are welcome,
>
> Kind regards,
>
> Raphaël

Re: MINA 3.0 Thrift and Protobuf support

Posted by Raphaël Barazzutti <ra...@gmail.com>.
Hi Ashish,

You're right, to decode fragmented packet I need to keep track of the data
before the message is complete.

With MINA 2.0, I'm using a CumulativeProtocolDecoder to handle these
issues.

I'll fix this using a context in my decoders,

I agree with you that MINA 3.0 might need something like a
CumulativeProtocolDecoder.

Thanks you,

Raphaël



On Sun, May 5, 2013 at 7:05 AM, Ashish <pa...@gmail.com> wrote:

> Thanks Raphael !
>
> Had a quick look at the code. One quick question, for fragmented packets,
> you need to store the data till the message is complete. I couldn't find
> where you are doing this. May be I am missing something.
>
> I am currently playing around with an Avro decoder. Approach is similar,
> but with slight semantic changes. I am currently trying to get a fixed
> length prefix decoder implementation. It works very similar to your
> approach, but instead of a SizeDecoder, it passes the size of length
> prefix. It will then accumulate bytes till message size is complete and
> then pass onto Avro decoder to decode the messages. My implementation is
> still in initial stage.
>
>
> On Sun, May 5, 2013 at 5:01 AM, Raphaël Barazzutti <
> raphael.barazzutti@gmail.com> wrote:
>
> > Hi MINA-developers!
> >
> > Using extensively MINA 2.0 at my work, I’d like to contribute to the next
> > MINA version.
> >
> > IMHO, MINA 3.0 could provide serialization facilities like Apache Thrift
> > and Google Protobuf transport.
> >
> > According to that I decide to propose the following code to be merged
> with
> > the main repository of MINA 3.0.
> >
> > Please have a look to my repo : https://github.com/rbarazzutti/mina
> >
> > Suggestions are welcome,
> >
> > Kind regards,
> >
> > Raphaël
> >
>
>
>
> --
> thanks
> ashish
>
> Blog: http://www.ashishpaliwal.com/blog
> My Photo Galleries: http://www.pbase.com/ashishpaliwal
>

Re: MINA 3.0 Thrift and Protobuf support

Posted by Ashish <pa...@gmail.com>.
Thanks Raphael !

Had a quick look at the code. One quick question, for fragmented packets,
you need to store the data till the message is complete. I couldn't find
where you are doing this. May be I am missing something.

I am currently playing around with an Avro decoder. Approach is similar,
but with slight semantic changes. I am currently trying to get a fixed
length prefix decoder implementation. It works very similar to your
approach, but instead of a SizeDecoder, it passes the size of length
prefix. It will then accumulate bytes till message size is complete and
then pass onto Avro decoder to decode the messages. My implementation is
still in initial stage.


On Sun, May 5, 2013 at 5:01 AM, Raphaël Barazzutti <
raphael.barazzutti@gmail.com> wrote:

> Hi MINA-developers!
>
> Using extensively MINA 2.0 at my work, I’d like to contribute to the next
> MINA version.
>
> IMHO, MINA 3.0 could provide serialization facilities like Apache Thrift
> and Google Protobuf transport.
>
> According to that I decide to propose the following code to be merged with
> the main repository of MINA 3.0.
>
> Please have a look to my repo : https://github.com/rbarazzutti/mina
>
> Suggestions are welcome,
>
> Kind regards,
>
> Raphaël
>



-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal